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循环%...