fprintf size without knowing the dimension

14 vues (au cours des 30 derniers jours)
John
John le 14 Juil 2017
Commenté : John le 14 Juil 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?

Réponse acceptée

Honglei Chen
Honglei Chen le 14 Juil 2017
Modifié(e) : Honglei Chen le 14 Juil 2017
You can just do
fprintf(' %s\n',num2str(size(array)));
HTH
  1 commentaire
John
John le 14 Juil 2017
Smart idea! Thanks.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by