for p=1:5
S0=[0.1 0.2 0.3 0.4 0.5];
D0=[2.1 2.2 2.3 2.4 2.5];
for rep1=length(S0(p))
for rep2=length(D0(p));
Sr=S0(rep1);
Du=D0(rep2);
end
end
I need to evaluate the below condition. How can i change the above code.
S0 1st value & D0 1st value;
S0 2nd value & D0 2nd value;
S0 3rd value & D0 3rd value;
S0 4th value & D0 4th value;
S0 5th value & D0 5th value.

 Réponse acceptée

Stephen23
Stephen23 le 31 Jan 2019
S0 = [0.1,0.2,0.3,0.4,0.5];
D0 = [2.1,2.2,2.3,2.4,2.5];
for k = 1:numel(S0)
Sr = S0(k);
Du = D0(k);
... the rest of your code
end

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by