필터 지우기
필터 지우기

write an Linear equation

조회 수: 1 (최근 30일)
tusu
tusu 2014년 11월 2일
댓글: tusu 2014년 11월 3일
Hi,
I have an eqn like this
xi+zihi+wi-wizi<=xj+23xij+23yij..........{1}
now, here i=1 and j=2, so it shall be
x1+z1h1+w1-w1z1<=x2+23x12+23y12
now if h1=4 and w1=5
then it becomes
x1+4z1+4-5z1<=x2+23x12+23y12
or
x1-z1-x2-23x12-23y12<=-4............{2}
is it possible to generate eqn(2) in matlab from eqn(1),if I know value of i and j and w1 and h1? means is this subtraction can be done? i.e 4z1-5z1=-z1?
Does matlab allow dealing with such equations with xi,yi,wi,hi as variable?

답변 (1개)

Matt J
Matt J 2014년 11월 2일
You can do things like this
>> linsys=@(a,b,c) [a b;1 c] ;
>> A=linsys(1,2,3)
A =
1 2
1 3
The matrix A can now be used to describe a linear equality or inequality.
  댓글 수: 1
tusu
tusu 2014년 11월 3일
how can I write this variable as x1 or x2.i,e xi..matlab can't deal with such equation.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by