Borrar filtros
Borrar filtros

How to save outputs of a function to different matrixs

1 visualización (últimos 30 días)
function F=fxyz(X)
x=X(1);
y=X(2);
z=X(3);
F(1)=x+y+z;
F(2)=3*x+5*y+6*z;
F(3)=x-3*y-6*z-1;
end
[B(1,2),C(1,3),D(1,1)]=fsolve('fxyz',[-1,1,-1])
Assignment has more non-singleton rhs dimensions than non-singleton subscripts

Respuesta aceptada

Stalin Samuel
Stalin Samuel el 4 de Mayo de 2016
The function 'xyz' returns the vector 'F' which has three elements.So follow the below steps
F =fsolve('fxyz',[-1,1,-1]);
B(1,2)=F(1);
C(1,3)=F(2);
D(1,1)=F(3);

Más respuestas (0)

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by