用MATLAB设计程式.PPT

用MATLAB设计程式

What is programming? Programming ? computer program *.m Make decision~ loop Switch 寫程式 4.1 Relational operators 關係運算子 ‘=‘ assignment operator; replacement operator x=3 ~ x?3 ?x=2 x = 2 ?y=5 y = 5 ?z=xy z = 1 ?u=x==y u = 0 優先順序 計算符號+-/ 優於 關係運算子 由左而右 z=53~=1 z=(53)~=1 z=0 4.2 Logical operators and Functions 邏輯運算子與函式 ?x=[6,3,9]; ?y=[14,2,9]; ?z=~xy z = 0 0 0 ?z=(~x)y z = 0 0 0 ?z=~(xy) z = 1 0 1 ?z=(x=y) z = 1 0 1 or ?x=[6,3,9]; ?y=[14,2,9]; ?z=x|y z = 1 1 1 ?z=[5,-3,0,0]|[2,4,0,5] z = 1 1 0

文档评论(0)

1亿VIP精品文档

相关文档