About save symbolic problem!!

3 views (last 30 days)
tony kevine
tony kevine on 26 Feb 2015
Commented: tony kevine on 27 Feb 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 !!

Accepted Answer

Sean de Wolski
Sean de Wolski on 26 Feb 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);

More Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!