循环、判断语法

Matlab:
 
1、
for a = 10:20                          % for 的取值还可以这样写: for a = [ 1:10 4 6 7 8 ]
   fprintf('value of a: %d\n', a);
end
 
R:
1、
    for (value in that) {
        this
    } 
 
2、
    while(condition){
        code
    }
 
判断:
matlab:
R:

猜你喜欢

转载自www.cnblogs.com/jwg-fendi/p/10052798.html