Quiero generar un archivo de texto de la variable z que contiene en caracteres un nombre. Pero el archivo generado .txt me salen números decimales y yo quiero todo el texto
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
nombre = [74 101 115 115 105 99 97] %El nombre que guarda el arreglo es Jessica
z = char(nombre) % en la ventana de comandos si sale el nombre Jessica
save -ascii mydata.txt z %Al abrir el archivo de texto salen los siguientes numeros
% 7.4000000e+01 1.0100000e+02 1.1500000e+02 1.1500000e+02 1.0500000e+02 9.9000000e+01 9.7000000e+01
0 Kommentare
Antworten (1)
Rik
am 26 Mär. 2023
If you want to write text, you need to write text. You either need to convert your variable to char, or use fprintf with an appropriate format specification ('c' or 's').
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!