Matlab - ERROR AL GUARDAR EN .txt

 
Vista:

ERROR AL GUARDAR EN .txt

Publicado por FRANCISCO (1 intervención) el 28/01/2016 23:07:14
Hola a todos, tengo la siguiente matriz con datos que vendrian siendo todos string:

resultado_guardar = { ' ' ' ' 'TABLA RESUMEN DE RESULTADOS' ' ' ' ' ;
' ' ' ' 'PROCESO 1' ' ' ' ' ;
'(X) :' num2str(X) '|' 'V.D(X) :' num2str(VDX) ;
'(Y) :' num2str(Y) '|' 'V.D(Y) :' num2str(VDY) ;
'(Z) :' num2str(Z) '|' 'V.D(Z) :' num2str(VDZ) ;
' ' ' ' 'PROCESO 2' ' ' ' ' ;
'x:' num2str(x) '|' 'R:' num2str(R) ;
'y:' num2str(y) '|' ' ' ' ' ;
'z:' num2str(z) '|' 'S' num2str(S) ;
}

Pero sucede que me arroja el siguiente error y no guarda nada en el archivo

Warning: Attempt to write an unsupported data type to an ASCII file.
Variable 'nombre archivo' not written to file.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de JOSE JEREMIAS CABALLERO
Val: 6.975
Oro
Ha mantenido su posición en Matlab (en relación al último mes)
Gráfica de Matlab

ERROR AL GUARDAR EN .txt

Publicado por JOSE JEREMIAS CABALLERO (5917 intervenciones) el 28/01/2016 23:49:47
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
X=round(5*rand);
Y=round(5*rand);
Z=round(5*rand);
x=round(5*rand);
y=round(5*rand);
z=round(5*rand);
VDX=round(5*rand);
VDY=round(5*rand);
VDZ=round(5*rand);
R=round(5*rand);
S=round(5*rand);
resultado_guardar = { ' ' ' ' 'TABLA RESUMEN DE RESULTADOS' ' ' ' ' ;
' ' ' ' 'PROCESO 1' ' ' ' ' ;
'(X) :' num2str(X) '|' 'V.D(X) :' num2str(VDX) ;
'(Y) :' num2str(Y) '|' 'V.D(Y) :' num2str(VDY) ;
'(Z) :' num2str(Z) '|' 'V.D(Z) :' num2str(VDZ) ;
' ' ' ' 'PROCESO 2' ' ' ' ' ;
'x:' num2str(x) '|' 'R:' num2str(R) ;
'y:' num2str(y) '|' ' ' ' ' ;
'z:' num2str(z) '|' 'S' num2str(S) ;
}
    save('archivo.mat', 'resultado_guardar');

1
>> salvar_cellda

1
2
3
4
5
6
7
8
9
10
11
12
13
14
>> A=load('archivo.mat')
A =
    resultado_guardar: {9x5 cell}
>> A.resultado_guardar
ans =
    ' '        ' '    [1x27 char]    ' '           ' '
    ' '        ' '    'PROCESO 1'    ' '           ' '
    '(X) :'    '4'    '|'            'V.D(X) :'    '1'
    '(Y) :'    '5'    '|'            'V.D(Y) :'    '3'
    '(Z) :'    '1'    '|'            'V.D(Z) :'    '5'
    ' '        ' '    'PROCESO 2'    ' '           ' '
    'x:'       '5'    '|'            'R:'          '5'
    'y:'       '3'    '|'            ' '           ' '
    'z:'       '0'    '|'            'S'           '1'



Saludos
JOSE JEREMÍAS CABALLERO
Asesoría online en Matlab
[email protected]
Toda ayuda gratuita es vía foro


http://matlabcaballero.blogspot.com
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

ERROR AL GUARDAR EN .txt

Publicado por FRANCISCO (1 intervención) el 29/01/2016 00:03:14
Pero es posible guardar eso en un bloc de notas?????
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de JOSE JEREMIAS CABALLERO
Val: 6.975
Oro
Ha mantenido su posición en Matlab (en relación al último mes)
Gráfica de Matlab

ERROR AL GUARDAR EN .txt

Publicado por JOSE JEREMIAS CABALLERO (5917 intervenciones) el 29/01/2016 05:40:36
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
clear all
X=round(5*rand);
Y=round(5*rand);
Z=round(5*rand);
x=round(5*rand);
y=round(5*rand);
z=round(5*rand);
VDX=round(5*rand);
VDY=round(5*rand);
VDZ=round(5*rand);
R=round(5*rand);
S=round(5*rand);
resultado_guardar = { ' ' ' ' 'TABLA RESUMEN DE RESULTADOS' ' ' ' ' ;
' ' ' ' 'PROCESO 1' ' ' ' ' ;
'(X) :' num2str(X) '|' 'V.D(X) :' num2str(VDX) ;
'(Y) :' num2str(Y) '|' 'V.D(Y) :' num2str(VDY) ;
'(Z) :' num2str(Z) '|' 'V.D(Z) :' num2str(VDZ) ;
' ' ' ' 'PROCESO 2' ' ' ' ' ;
'x:' num2str(x) '|' 'R:' num2str(R) ;
'y:' num2str(y) '|' ' ' ' ' ;
'z:' num2str(z) '|' 'S' num2str(S) ;
}
 
direccion=fopen('resultados.txt','w')
for i=1:size(resultado_guardar,1)
    for j=1:size(resultado_guardar,2)
   fprintf(direccion,'%s',resultado_guardar{i,j})
    end
    fprintf(direccion,'\n')
end
fclose(direccion)
open('resultados.txt');


Saludos
JOSE JEREMÍAS CABALLERO
Asesoría online en Matlab
[email protected]
Toda ayuda gratuita es vía foro


http://matlabcaballero.blogspot.com
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar