- for 循环基本格式
- for 循环变量=起始值:步长:终止值
end
- while 表达式
while 表达式
循环体
End
- 如果使用;可以不显示具体的值
如果不加;的话所有的值均会被显示出来
- Matlab画图
>> x=0:pi/100:2*pi;
>> y=sin(x);
>> plot(x,y)
- 矩阵的提取
end
while 表达式
循环体
End
如果不加;的话所有的值均会被显示出来
>> x=0:pi/100:2*pi;
>> y=sin(x);
>> plot(x,y)