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

3 vues (au cours des 30 derniers jours)
Mallouli Marwa
Mallouli Marwa le 5 Mai 2016
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

Réponse acceptée

Image Analyst
Image Analyst le 5 Mai 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 commentaires
Image Analyst
Image Analyst le 5 Mai 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
Mallouli Marwa
Mallouli Marwa le 6 Mai 2016
thanks

Connectez-vous pour commenter.

Plus de réponses (1)

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

Connectez-vous pour commenter.

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by