poster
2019-12-10, 20:48
有没有一种方法可以在MATLAB中使用非线性间隔(例如对数刻度)创建for循环?我知道我可以使用while循环,但是我想知道是否存在像for循环这样的简单事情。
回答:
这是您要找的东西吗?
for ctr = logspace(1,10,100) disp(ctr) end for循环变量可以覆盖任何数组。您可以这样做:
x = [1 2 4 4 3 10]; for ctr = x disp(ctr) end 也一样
更多&回答... (https://stackoverflow.com/questions/4545195)
回答:
这是您要找的东西吗?
for ctr = logspace(1,10,100) disp(ctr) end for循环变量可以覆盖任何数组。您可以这样做:
x = [1 2 4 4 3 10]; for ctr = x disp(ctr) end 也一样
更多&回答... (https://stackoverflow.com/questions/4545195)