how to vectorize these for loop

3 Ansichten (letzte 30 Tage)
Anita pawar
Anita pawar am 12 Sep. 2017
Kommentiert: Rik am 12 Sep. 2017
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 Kommentare
James Tursa
James Tursa am 12 Sep. 2017
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 am 12 Sep. 2017
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by