How can i display a vector as a result of a for loop ?

1 visualización (últimos 30 días)
I have thi loop for and i want to display the mmk but i can't for rload=0:20:50000 v = -x(:,3)*rload; mn =(max(v)-min(v))/2 mk=mn'; end

Respuesta aceptada

Image Analyst
Image Analyst el 5 de Mayo de 2016
Index the variables and leave off the semicolon
for rload=0:20:50000
v = -x(:,3)*rload;
mn =(max(v)-min(v))/2 % A single number.
mk(rload) = mn
end
  3 comentarios
Image Analyst
Image Analyst el 5 de Mayo de 2016
The index can't be zero. Use a counter index that starts at 1.
index = 1;
for rload=0:20:50000
v = -x(:,3)*rload;
mn =(max(v)-min(v))/2 % A single number.
mk(index) = mn
index = index + 1;
end

Iniciar sesión para comentar.

Más respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 5 de Mayo de 2016
mk=mn';
remove the semi colon
mk=mn'
  1 comentario
Mallouli Marwa
Mallouli Marwa el 5 de Mayo de 2016
this loop for allow me to obtain the last value of mk. This is my problem

Iniciar sesión para comentar.

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by