필터 지우기
필터 지우기

Problem in linsolve , the equation on the left side not accepted

조회 수: 1 (최근 30일)
farzad
farzad 2014년 12월 8일
댓글: Geoff Hayes 2014년 12월 9일
Hi All
I am defining equation as :
M_num = - (19*c2)/4 - (11*c3)/18 - 50 ;
M_n2 = - 7*c2 - (5*c3)/18 - 50 ;
then I have :
linsolve({M_num = 0, M_n2 = 0}, {c2, c3}) ;
and I get the error :
Error: The expression to the left of the equals sign is not a valid target for an assignment.
WHY ??

채택된 답변

Geoff Hayes
Geoff Hayes 2014년 12월 8일
Farzad - see the documentation for linsolve. If you are trying to solve the system of equations Ax=B, then you need to define your A and B with two unknowns of c2 and c3, then you should try something like
A = [-19/4 -11/18 ; -7 -5/18];
B = [50 ; 5];
X = linsolve(A,B);
  댓글 수: 2
Image Analyst
Image Analyst 2014년 12월 9일
farzad's reply moved from being an "Answer" to being a comment:
Thanks Geof , but I was doing according to : here
and you see they wrote the equations directly , ok then , in this case , since I am letting matlab to repalce and produce the equations and then solve them , so I can not intervene in the middle and extract those coefficients to replace here , but is there a way to do this ?
Geoff Hayes
Geoff Hayes 2014년 12월 9일
Farzad - you are referencing code that is used in the MuPad interface. Is that what you are using?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by