About save symbolic problem!!
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
tony kevine
le 26 Fév 2015
Commenté : tony kevine
le 27 Fév 2015
i have a matrix 3by3,and i want to save into txt type,i use the command save,but it give me "Warning: Attempt to write an unsupported data type to an ASCII file.Variable 'D' not written to file. " can anyone help me !! thanks !!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147328/image.png)
0 commentaires
Réponse acceptée
Sean de Wolski
le 26 Fév 2015
I's use evalc to capture the symbolic expression as a string and then write it out:
% Something symbolic
syms x
y = [x sin(x) cos(x)].'*[x sin(x) cos(x)] % some symbolic matrix
%String it
str = evalc('y'); % to string
% Write it
fid = fopen('out.txt','w');
fprintf(fid,str);
fclose(fid);
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox 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!