Store vector values in a array
古いコメントを表示
Hi,
I am trying to store the output of a calculation
5
6
9
10
which is a vector into an array. Can someone please help? TIA
回答 (1 件)
Bryant Lash
2019 年 4 月 16 日
Hi, it's not clear what you're trying to accomplish. Is
Array = [5,6,9,10]
a suitable answer? If not, please be more speicific with your issue.
6 件のコメント
Kiruthiga Sekar
2019 年 4 月 16 日
Bryant Lash
2019 年 4 月 16 日
編集済み: Bryant Lash
2019 年 4 月 16 日
So in this case, you would like 0.7 and 0.9 stored in an array?
You can accomplish this by adding the following line at the end.
Array = info(idx)
Kiruthiga Sekar
2019 年 4 月 16 日
Bryant Lash
2019 年 4 月 16 日
編集済み: Bryant Lash
2019 年 4 月 16 日
Okay. idx is already a vector, which is practically identical to an array ( see https://www.mathworks.com/matlabcentral/answers/342697-what-s-the-difference-between-vectors-and-arrays )
Are you trying to append it to an already existing array?
You can accomplish that by
AlreadyExistingArray(:,end+1) = idx;
Assuming that they are the same size.
Kiruthiga Sekar
2019 年 4 月 16 日
Bryant Lash
2019 年 4 月 16 日
Did that answer your question?
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!