I keep getting the error message that the variables must be of data type double and it is currently of type sym.
6 次查看(过去 30 天)
显示 更早的评论
%I'm unsure how else to run this code to solve the 10 eqn system where
%the answer comes out in the correct form, please help
syms AB BC AD BD CD DE CE Ax Ay Ey
eqn1=Ax+AD==0;
eqn2=Ay+AB==0;
eqn3=74+BC+(3/5)*BD==0;
eqn4=-AB-(4/5)*BD==0;
eqn5=-BC+(3/5)*CE==0;
eqn6=-24-CD-(4/5)*CE==0;
eqn7=-AD+DE-(3/5)*BD==0;
eqn8=CD+(4/5)*BD==0;
eqn9=-DE-(3/5)*CE==0;
eqn10=Ey+(4/5)*CE==0;
[AB BC AD BD CD DE CE Ax Ay Ey]=solve(eqn1, eqn2, eqn3, eqn4, eqn5, eqn6, eqn7, eqn8, eqn9, eqn10,[AB BC AD BD CD DE CE Ax Ay Ey])
2 个评论
Walter Roberson
2024-2-21
编辑:Walter Roberson
2024-2-21
The code works properly here.
Try
restoredefaultpath; rehash toolboxcache
采纳的回答
Walter Roberson
2024-2-21
%I'm unsure how else to run this code to solve the 10 eqn system where
%the answer comes out in the correct form, please help
syms AB BC AD BD CD DE CE Ax Ay Ey
eqn1=Ax+AD==0;
eqn2=Ay+AB==0;
eqn3=74+BC+(3/5)*BD==0;
eqn4=-AB-(4/5)*BD==0;
eqn5=-BC+(3/5)*CE==0;
eqn6=-24-CD-(4/5)*CE==0;
eqn7=-AD+DE-(3/5)*BD==0;
eqn8=CD+(4/5)*BD==0;
eqn9=-DE-(3/5)*CE==0;
eqn10=Ey+(4/5)*CE==0;
[AB BC AD BD CD DE CE Ax Ay Ey]=solve(eqn1, eqn2, eqn3, eqn4, eqn5, eqn6, eqn7, eqn8, eqn9, eqn10,[AB BC AD BD CD DE CE Ax Ay Ey]);
AB = double(AB);
BC = double(BC);
AD = double(AD);
BD = double(BD);
DE = double(DE);
CE = double(CE);
Ax = double(Ax);
Ay = double(Ay);
Ey = double(Ey);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Special Values 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!