Taking symbolic variables out of txt file and making a matrix

조회 수: 1 (최근 30일)
Mirroyal Ismayilov
Mirroyal Ismayilov 2019년 2월 17일
I have a txt file containing following characters.
theta1 , l1 and others are symbolic variables.( Don't mind about it)
M=[theta1 + (l1^2*m1)/4 + l1^2*m2 (l1*l2*m2*cos(fi1 - fi2))/2 ;
(l1*l2*m2*cos(fi1 - fi2))/2 theta2 + (l2^2*m2)/4 ]
I need to take it out and make it a symbolic matrix. As you can see txt file is already fine for making matrix but I don't want to copy paste the whole thing to script, I rather want to do it automatically.
fid = fopen('a.txt');
MMatrix=textscan(fid,'%s');
fclose(fid);
I tried the code above but it turn out to be not useful. What do you think is the way to copy the whole thing and use it for matrix making?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by