fprintf size without knowing the dimension

How can I print the size of the array in one row without prior-knowing the dimension of the array?
fprintf(' %d\n',size(array));
How many %d to put there? or how to do it right?

 採用された回答

Honglei Chen
Honglei Chen 2017 年 7 月 14 日
編集済み: Honglei Chen 2017 年 7 月 14 日

0 投票

You can just do
fprintf(' %s\n',num2str(size(array)));
HTH

1 件のコメント

John
John 2017 年 7 月 14 日
Smart idea! Thanks.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

製品

タグ

質問済み:

2017 年 7 月 14 日

コメント済み:

2017 年 7 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by