Converting disp answers to vector/str2num

2 ビュー (過去 30 日間)
Cside
Cside 2019 年 12 月 1 日
コメント済み: Jesus Sanchez 2019 年 12 月 1 日
I have code line that goes as such. It displays all the answers from earlier part of the code's for loop iterations and I would like to use str2num to convert the disp answers to a matrix. However, there is an error "too many input arguments". Is there another way I can use str2num with disp, or another function similar to disp, just that its form is in a vector? Thank you!
disp (find(A))
  4 件のコメント
Turlough Hughes
Turlough Hughes 2019 年 12 月 1 日
Can you provide an example of A. Also, why do you need to display all the indices of A, I suspect disp(numel(A)), or disp(size(A)) would be preferable.
Jesus Sanchez
Jesus Sanchez 2019 年 12 月 1 日
Then, as Kalyan answered, fprintf is a good option for your problem. Good luck! :)

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

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 12 月 1 日

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by