how to solve this MATLAB solve error?

4 views (last 30 days)
Randy Chen
Randy Chen on 1 Oct 2021
Answered: Jan on 2 Oct 2021
I'm trying to solve a simple set of linear equations:
syms m U2
eqn1 = 0.0004*200*10^6*(-3/4*U2-sqrt(3)/4*0.05)==0;
eqn2 = 0.0004*200*10^6*(sqrt(3)/4*U2+1/4*0.05)== -m*9.81;
sol = solve([eqn1,eqn2]);
However, this error is returned:
Error using solve (line 90)
Error using maplemex
Error, (in MTM:-solve) Vector[row](2, [0,0], datatype = integer[1]) is not valid equation or expression
Error in group_challenge2 (line 21)
sol = solve([eqn1,eqn2]);
How should I fix this issue?

Accepted Answer

Jan
Jan on 2 Oct 2021
This looks suspicious: "datatype = integer[1]" ?!
Maybe there is some preceeding code, which causes problems? At least the show piece of code is running fine here:
syms m U2
eqn1 = 0.0004*200*10^6*(-3/4*U2-sqrt(3)/4*0.05)==0;
eqn2 = 0.0004*200*10^6*(sqrt(3)/4*U2+1/4*0.05)== -m*9.81;
sol = solve([eqn1,eqn2])
sol = struct with fields:
U2: -3^(1/2)/60 m: 0

More Answers (0)

Categories

Find more on Particle & Nuclear Physics 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!