How to get answers to appear as an array?
5 ビュー (過去 30 日間)
古いコメントを表示
I have a word that I switched to ASCII code. I then used a loop to make the resulting numbers change to the numbers that I want. My question is: how would I go about making those numbers appear as an array? They currently appear as:
ans=
ans=
ans=
3 件のコメント
Stephen23
2020 年 1 月 27 日
"...but all it talked about was finding certain numbers in an array that was already created."
Which is exactly the recommended approach:
回答 (1 件)
Adam Danz
2020 年 1 月 26 日
編集済み: Adam Danz
2020 年 1 月 27 日
It looks like your outputs are being produced within a loop. Instead of displaying their values within the loop, collect the values within a vector (or cell array if the values are not all numeric scalars) and then display the final result after the loop.
2 件のコメント
Stephen23
2020 年 1 月 27 日
@Adam Danz: that is a curious page to link to: surely it would make more sense to link to a page explaining indexing (of which there are plenty in the documentation), rather than a page about avoiding dynamically naming variables (something the original question does not mention anywhere).
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!