How to do a function of equations?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jurgen
am 16 Sep. 2014
Kommentiert: Jurgen
am 16 Sep. 2014
I want to make a function using 4 equations, something like fun = @ (w, x, y, z) [eq1, eq2, eq3; eq4], however it does not work. The only way that the function has worked is directly copying the value of each of the four equations in the function, However this does not help me because the function is inside a iterative cycle where the value of the equations change between each iteration. Is any way of solve my problem?
Thanks in advance!
2 Kommentare
Physiker192
am 16 Sep. 2014
could you please give more details like a little example so we can help you?
Akzeptierte Antwort
Mischa Kim
am 16 Sep. 2014
Bearbeitet: Mischa Kim
am 16 Sep. 2014
Jurgen, do you mean something like:
eq1 = @(x) x(1)*x(2);
eq2 = @(y) y(1) - 2;
fun = @(z) [eq1(z); eq2(z)];
fun([3,2])
ans =
6
1
4 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!