matlab re-orders my equation
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hi guys
so am trying to get coefficient of an eqtion in matlab but matlab keeps changing the order of terms after defining the equation or making a derivetive of it:
Phi1=C11*sin(Alpha1*X1)+C12*cos(Alpha1*X1)+C13*sinh(Alpha1*X1)+C14*cosh(Alpha1*X1);
eqn1= Phi1==0;
eqn2=diff(Phi,X1)==0;
since order of the C11, C12, C13, C14 coefficents changes in the above equation below line does not work:
coeffs(lhs(eqn1),[C11 C12 C13 C14])
and one more thing, how can I put zero insted of the coefficents which are not exist, for example if I replace X1 with zero then I want to get :
[0 1 0 1] insted of [1 1]
thanks a lot
0 Kommentare
Antworten (2)
Steven Lord
am 25 Okt. 2019
Call coeffs with two output arguments.
>> [C, T] = coeffs(lhs(eqn1), [C11 C12 C13 C14])
0 Kommentare
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!