Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Solve functions symbolically, and getting answers as functions, solve() fsolve()

1 visualización (últimos 30 días)
Ori Iger
Ori Iger el 5 de Mayo de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hello
This is my humble piece of code, solving a system of three linear equations to get all C_xy_0.
syms x y z
eqns = [(1-J11(J11_0))*x-J12(J12_0)*y == (J11(J11_0)*C1)/N_1 , (1-J22(J22_0))*z-J21(J21_0)*y == (J22(J22_0)*C2)/N_2 , (2-(J11(J11_0)+J22(J22_0)))*y == J12(J12_0)*(x+C2/N_2) + J21(J21_0)*(z+C1/N_1)];
result = solve(eqn);
C_11_0 = result.x;
C_12_0 = result.y;
C_21_0 = C_12_0;
C_22_0 = result.z;
Trying desperatly to find a way to get the solution as functions of the function "Jxy()", or as a function of the parameter "Jxy_0", such as C_xy_0 ( Jxy(Jxy_0) ) .
For example, something sort of like
C_11_0 = @(J11_0) result.x(J11(J11_0))
C_12_0 = @(J12_0) result.y(J12(J12_0))
.
.
Thanks a lot in advance!
Uri

Respuestas (1)

Matt J
Matt J el 5 de Mayo de 2020
Editada: Matt J el 5 de Mayo de 2020
C_11_0 = matlabFunction( result.x ) ;
C_12_0 = matlabFunction( result.y ) ;
  2 comentarios
Ori Iger
Ori Iger el 5 de Mayo de 2020
getting
Dot indexing is not supported for variables of this type.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by