Borrar filtros
Borrar filtros

How to see matrix of struct type

1 visualización (últimos 30 días)
Gabriel Oliviero
Gabriel Oliviero el 28 de Mzo. de 2016
Comentada: Star Strider el 28 de Mzo. de 2016
Hello, I solved a equation and the answer was:
s: [8x1 sym]
x2: [8x1 sym]
How can I see this matrix builded?

Respuestas (1)

Star Strider
Star Strider el 28 de Mzo. de 2016
Editada: Star Strider el 28 de Mzo. de 2016
In the script, I would type after the solve call:
soln = solve( ... , [s, x2])
soln.s
soln.x2
That should display them for you.
  2 comentarios
Gabriel Oliviero
Gabriel Oliviero el 28 de Mzo. de 2016
Actually I have this:
if true
sx2 = solve(('((c8+c9+c10)*s+k8)*(-(((((x2*(k3 + c3*s) - ((x2*(m2*s^2 + (c1 + c2 + c3 + c4)*s + k1 + k2 + k3) - ((k2 + c2*s)*(f + x2*(k2 + c2*s)))/(m1*s^2 + c2*s + k2))*(m3*s^2 + (c3 + c5)*s + k3 + k5))/(k3 + c3*s))*(m4*s^2 + (c5 + c6)*s + k5 + k6))/(k5 + c5*s) + ((k5 + c5*s)*(x2*(m2*s^2 + (c1 + c2 + c3 + c4)*s + k1 + k2 + k3) - ((k2 + c2*s)*(f + x2*(k2 + c2*s)))/(m1*s^2 + c2*s + k2)))/(k3 + c3*s))*(m5*s^2 + (c6 + c7 + c8 + c9)*s + k6 + k8))/(k6 + c6*s) - ((k6 + c6*s)*(x2*(k3 + c3*s) - ((x2*(m2*s^2 + (c1 + c2 + c3 + c4)*s + k1 + k2 + k3) - ((k2 + c2*s)*(f + x2*(k2 + c2*s)))/(m1*s^2 + c2*s + k2))*(m3*s^2 + (c3 + c5)*s + k3 + k5))/(k3 + c3*s)))/(k5 + c5*s))/(c9*s))-(c9*s)*(-(((x2*(k3 + c3*s) - ((x2*(m2*s^2 + (c1 + c2 + c3 + c4)*s + k1 + k2 + k3) - ((k2 + c2*s)*(f + x2*(k2 + c2*s)))/(m1*s^2 + c2*s + k2))*(m3*s^2 + (c3 + c5)*s + k3 + k5))/(k3 + c3*s))*(m4*s^2 + (c5 + c6)*s + k5 + k6))/(k5 + c5*s) + ((k5 + c5*s)*(x2*(m2*s^2 + (c1 + c2 + c3 + c4)*s + k1 + k2 + k3) - ((k2 + c2*s)*(f + x2*(k2 + c2*s)))/(m1*s^2 + c2*s + k2)))/(k3 + c3*s))/(k6 + c6*s))'),'x2/f')
end
where s, x2 and f are syms, and the rest are constants, and I want to get a result in funtion of x2/f.
Star Strider
Star Strider el 28 de Mzo. de 2016
I would appreciate your also posting your syms call so I can run your code.
While I’m waiting for you to post that, I would follow a different strategy, since you cannot solve for ‘x2/f’:
x2s = solve((((c8+c9+c10)*s+k8)*(-(((((x2*(k3 + c3*s) - ((x2*(m2*s^2 + (c1 + c2 + c3 + c4)*s + k1 + k2 + k3) - ((k2 + c2*s)*(f + x2*(k2 + c2*s)))/(m1*s^2 + c2*s + k2))*(m3*s^2 + (c3 + c5)*s + k3 + k5))/(k3 + c3*s))*(m4*s^2 + (c5 + c6)*s + k5 + k6))/(k5 + c5*s) + ((k5 + c5*s)*(x2*(m2*s^2 + (c1 + c2 + c3 + c4)*s + k1 + k2 + k3) - ((k2 + c2*s)*(f + x2*(k2 + c2*s)))/(m1*s^2 + c2*s + k2)))/(k3 + c3*s))*(m5*s^2 + (c6 + c7 + c8 + c9)*s + k6 + k8))/(k6 + c6*s) - ((k6 + c6*s)*(x2*(k3 + c3*s) - ((x2*(m2*s^2 + (c1 + c2 + c3 + c4)*s + k1 + k2 + k3) - ((k2 + c2*s)*(f + x2*(k2 + c2*s)))/(m1*s^2 + c2*s + k2))*(m3*s^2 + (c3 + c5)*s + k3 + k5))/(k3 + c3*s)))/(k5 + c5*s))/(c9*s))-(c9*s)*(-(((x2*(k3 + c3*s) - ((x2*(m2*s^2 + (c1 + c2 + c3 + c4)*s + k1 + k2 + k3) - ((k2 + c2*s)*(f + x2*(k2 + c2*s)))/(m1*s^2 + c2*s + k2))*(m3*s^2 + (c3 + c5)*s + k3 + k5))/(k3 + c3*s))*(m4*s^2 + (c5 + c6)*s + k5 + k6))/(k5 + c5*s) + ((k5 + c5*s)*(x2*(m2*s^2 + (c1 + c2 + c3 + c4)*s + k1 + k2 + k3) - ((k2 + c2*s)*(f + x2*(k2 + c2*s)))/(m1*s^2 + c2*s + k2)))/(k3 + c3*s))/(k6 + c6*s))), x2);
x2_by_f = simplify(x2s/f, 'steps', 10)

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by