matlab re-orders my equation
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (2)
Steven Lord
el 25 de Oct. de 2019
Call coeffs with two output arguments.
>> [C, T] = coeffs(lhs(eqn1), [C11 C12 C13 C14])
0 comentarios
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!