fprintf size without knowing the dimension

15 visualizzazioni (ultimi 30 giorni)
John
John il 14 Lug 2017
Commentato: John il 14 Lug 2017
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?

Risposta accettata

Honglei Chen
Honglei Chen il 14 Lug 2017
Modificato: Honglei Chen il 14 Lug 2017
You can just do
fprintf(' %s\n',num2str(size(array)));
HTH

Più risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by