problem in save command: numerical data is saved using epsilon

1 vue (au cours des 30 derniers jours)
Safaa
Safaa le 4 Août 2015
Commenté : Star Strider le 7 Août 2015
Hello all,
I have a problem using save command to export numerical data(stored in array as integers)to text file. The stored results in the text file are represented using epsilon.
I have tried many ways to store the data as integers but nothing worked out! I have also used fprintf and dlmwrite commands but I did not get the suitable result (i.e the arrangement of data in the text field).
Any suggestions to save the data as integers? If this is not possible, how can I convert the data from epsilon format to integers?
Thanks,

Réponse acceptée

Star Strider
Star Strider le 4 Août 2015
It’s difficult to tell what you want to do. If you want to use fprintf, use the appropriate format descriptor (for example '%d', '%u').
To use the save function, cast the numbers a integers in your code, then save them as such.
For instance to convert ‘epsilon’ to unsigned 16-bit integers:
epsilon = uint16(epsilon);
Use the function that best suits your needs.
The save function will save them as you have defined them, and load will load them as the same data type.
  2 commentaires
Safaa
Safaa le 7 Août 2015
Many thanks for your answer. It worked out using fprintf command.
Star Strider
Star Strider le 7 Août 2015
My pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Import and Export dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by