Create a Vector fields

6 visualizaciones (últimos 30 días)
Alvaro Mª Zumalacarregui Delgado
Alvaro Mª Zumalacarregui Delgado el 20 de Feb. de 2021
Editada: KALYAN ACHARJYA el 20 de Feb. de 2021
I trying to create a vector field of a diferentials equation system, I write a code in matlab app designer but I not sure how to do it. I write this code but I can't run it, this is the code:
P = 50;
Q = 60;
a = app.a.Value;
b = app.b.Value;
N = 15;
xmin = 0;
xmax = 10;
ymin = 0;
ymax = 10;
[x,y] = meshgrid (xmin: (xmax-xmin)/N:xmax,ymin:(ymax-ymin)/N:ymax);
dx = (dy*(P-a*y))/(Q-b*x);
dy = (dx*(Q-b*x)/(P-a*y);
% in the line before i have this error Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
quiver (app.Axes,x,y,dx,dy);
Someone knows if this code is correct for getting a vector field or knows how to solve the error. Thanks

Respuestas (1)

KALYAN ACHARJYA
KALYAN ACHARJYA el 20 de Feb. de 2021
Editada: KALYAN ACHARJYA el 20 de Feb. de 2021
"% in the line before i have this error Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters"
dy = dx*(Q-b*x)/(P-a*y);
May be because of Extra Bracket..?

Categorías

Más información sobre Cell Arrays 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