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

1 回表示 (過去 30 日間)
Mallouli Marwa
Mallouli Marwa 2016 年 5 月 5 日
コメント済み: Mallouli Marwa 2016 年 5 月 6 日
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

採用された回答

Image Analyst
Image Analyst 2016 年 5 月 5 日
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 件のコメント
Image Analyst
Image Analyst 2016 年 5 月 5 日
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 2016 年 5 月 6 日
thanks

サインインしてコメントする。

その他の回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 5 月 5 日
mk=mn';
remove the semi colon
mk=mn'
  1 件のコメント
Mallouli Marwa
Mallouli Marwa 2016 年 5 月 5 日
this loop for allow me to obtain the last value of mk. This is my problem

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by