How to show results of for end values as a vector.

1 回表示 (過去 30 日間)
esat gulhan
esat gulhan 2020 年 8 月 23 日
回答済み: Alan Stevens 2020 年 8 月 23 日
Is there any way to represent results of for end as a vector.
for example
for h0=0:1:2
h=h0*2
end
results
ans
h =
0
h =
2
h =
4
But i want that result like a vector
ans
0 2 4
I know it without using for h0=0:1:2;h=h0*2 . But ı need to represent results of for end as a vector in my real code. can you help

採用された回答

Alan Stevens
Alan Stevens 2020 年 8 月 23 日
h0 = 0:2;
h = h0.*2

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by