MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   非线性for循环 (https://www.labfans.com/bbs/showthread.php?t=24269)

poster 2019-12-10 20:48

非线性for循环
 
有没有一种方法可以在MATLAB中使用非线性间隔(例如对数刻度)创建for循环?我知道我可以使用while循环,但是我想知道是否存在像for循环这样的简单事情。



[B]回答:[/B]

这是您要找的东西吗?

for ctr = logspace(1,10,100) disp(ctr) end for循环变量可以覆盖任何数组。您可以这样做:

x = [1 2 4 4 3 10]; for ctr = x disp(ctr) end 也一样



[url=https://stackoverflow.com/questions/4545195]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 01:01

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.