MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   考虑到matlab中的索引,如何最好地遍历数组? (https://www.labfans.com/bbs/showthread.php?t=23142)

poster 2019-12-10 20:30

考虑到matlab中的索引,如何最好地遍历数组?
 
我看过这个线程在谈论map: [URL="https://stackoverflow.com/questions/983163/map-function-in-matlab"]MATLAB中的Map函数?[/URL]

结果,我想知道是否有类似的方法可以将这些指标考虑在内。例如,如果我想做类似(x_i)^ i的事情。

非常感谢!



[B]回答:[/B]

一个例子:

>> x = randi(10, [1 5]) x = 9 7 4 10 1 >> x.^(1:numel(x)) ans = 9 49 64 10000 1

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


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

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