![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MATLAB
kyle-fang
希望成为一个牛气哄哄的人工智能科学家
展开
-
MATLAB程序设计-循环结构
while循环%while循环sum = 0; i = 1;x = input('Enter first value:');while x>=0 sum = sum+x; x = input('Enter next value:'); i = i+1;endmean = sum/i;fprintf('mean=%f\n',mean);for循环%...原创 2020-01-09 12:46:03 · 2450 阅读 · 0 评论 -
MATLAB程序设计-分支结构
分支结构a = 20;b = -2;c = 0;d = 1;%if结构if a<12 a = a + 4;elseif (a>12)&(a<24) a = a + 8;else a = a + 12;end%检验判别式if (b^2 - 4*a*c)>0 disp('this equation has two ...原创 2020-01-09 12:39:10 · 2821 阅读 · 0 评论