# I keep getting the error message that the variables must be of data type double and it is currently of type sym.

조회 수: 6 (최근 30일)
Ana 2024년 2월 21일
댓글: Ana 2024년 2월 21일
%I'm unsure how else to run this code to solve the 10 eqn system where
syms AB BC AD BD CD DE CE Ax Ay Ey
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;
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 =
BC =
74
BD =
CD =
DE =
46
CE =
Ax =
Ay =
Ey =
##### 댓글 수: 2없음 표시없음 숨기기
Walter Roberson 2024년 2월 21일
편집: Walter Roberson 2024년 2월 21일
The code works properly here.
Try
restoredefaultpath; rehash toolboxcache
Ana 2024년 2월 21일
it is still giving me these error messages
"Variable AB must be of data type double. It is currently of type sym. Check where the variable is assigned a value."
is it because I introduce them using 'syms', it also said i cannot use rehash in my code on Matlab Grader

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

### 채택된 답변

Walter Roberson 2024년 2월 21일
%I'm unsure how else to run this code to solve the 10 eqn system where
syms AB BC AD BD CD DE CE Ax Ay Ey
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;
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);
BD = double(BD);
DE = double(DE);
CE = double(CE);
Ax = double(Ax);
Ay = double(Ay);
Ey = double(Ey);
##### 댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
Ana 2024년 2월 21일
that worked perfectly thank you so much!

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

### 카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by