how to vectorize these for loop

1 次查看(过去 30 天)
Anita pawar
Anita pawar 2017-9-12
评论: Rik 2017-9-12
clc;
clear all;
close all;
a=[1,3,8];
for i=1:3
b(:,:,i)=sisobnds(a(i),w,wbd,ws,p,R,nompt);
end
plotbnds(b(:,:,1))
plotbnds(b(:,:,2))
plotbnds(b(:,:,3))
  3 个评论
James Tursa
James Tursa 2017-9-12
The loop only has 3 iterations. Even if vectorizing is possible with the sisobnds function, how much do you think it will help?
Rik
Rik 2017-9-12
Also a general tip: don't use clear all,close all. Use functions so separate workspaces and variables. If you insist on using it, use clear variables, so you can still use breakpoints.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Large Files and Big Data 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by