How do I store à calculated value in a loop in a Vector ?

Hello
I made à loop to calculate severals values, and I want to store them in a vector, How can I do this ?
Thanks for your help

回答 (1 件)

Marc Jakobi
Marc Jakobi 2013 年 11 月 5 日

1 投票

No idea what type of loop you are using or what you are trying to calculate, but maybe this can help. (You should always add a sample code so that people have an idea of what you are trying to do).
%if I put something in *...* it means it is something you have to fill in, because I don't %know what you are trying to do.
results = zeros(*amount of calculations*,1);
for i = 1:*amount of calculations*
results(i) = *calculation*;
end

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

質問済み:

2013 年 11 月 5 日

回答済み:

2013 年 11 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by