how can I convert an array in double format to string?

764 vues (au cours des 30 derniers jours)
Hugo
Hugo le 5 Sep 2021
Hi,
How can I convert an array, previously imported to MATLAB, in double format to string?
Thank you,

Réponse acceptée

Arkaniva Sarkar
Arkaniva Sarkar le 5 Sep 2021
You can either use string(arr) or num2str(arr), depending on what you desire. string(arr) will create a string array by converting each element in the array to string (for example, [ "1", "2", "3" ]) whereas num2str(arr) will convert the whole array into a string (example, [ '1 2 3' ]).

Plus de réponses (0)

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by