Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How to create indexes operations?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi!
I've this function:
for i = 1:length(I)
ydata_low(i,:) = [I_0(i) I_1(i) I_2(i) I_3(i) I_4(i)];
ydata_high(i,:) = [I_5(i) I_6(i) I_7(i) I_8(i)];
end
where 0,1,2,3,4,5,6,7,8 are indexes. I'd like, instead this, to do that ydata_low goes from I_0(i) to I_4(i) and ydata_high goes from I_5(i) to I_b(i), where b is 8. How can I do?
1 comentario
Dennis
el 9 de Mayo de 2018
Editada: Dennis
el 9 de Mayo de 2018
With proper indices! Instead of using several vector I_0 to I_X better add 1 dimension to I.
ydata_low(1:5,:) = I(1:5,:);
ydata_high(1:b-5,:) = I(6:b,:);
I do not know how you populate your Is', but I suggest to do it like
for ii=1:numberofdatasets
I(ii)= %put data in here
end
Stephen Cobeldick also put together a neat post about not naming variables I_0,I_1,I_2... https://de.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not-be-named-dynamically-eval
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!