About save symbolic problem!!

조회 수: 3 (최근 30일)
tony kevine
tony kevine 2015년 2월 26일
댓글: tony kevine 2015년 2월 27일
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 !!

채택된 답변

Sean de Wolski
Sean de Wolski 2015년 2월 26일
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);
  댓글 수: 1
tony kevine
tony kevine 2015년 2월 27일
thanks very much !!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by