fprintf size without knowing the dimension

8 views (last 30 days)
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?

Accepted Answer

Honglei Chen
Honglei Chen on 14 Jul 2017
Edited: Honglei Chen on 14 Jul 2017
You can just do
fprintf(' %s\n',num2str(size(array)));
HTH

More Answers (0)

Categories

Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!