How to plot constant vector field: f(x,y)=2 ax + ay

2 Ansichten (letzte 30 Tage)
Mustafa Shahid
Mustafa Shahid am 26 Mär. 2022
Kommentiert: VBBV am 30 Mär. 2022
x=-3:3;
>> y=-5:5;
>> [x,y]=meshgrid(x,y);
>> u=2;v=1;
>> quiver(x,y,u,v)
Error using quiver (line 44)
The size of X must match the size of U or the number of columns of U.

Akzeptierte Antwort

VBBV
VBBV am 26 Mär. 2022
Bearbeitet: VBBV am 26 Mär. 2022
x=-3:3;
y=-5:5;
[x,y]=meshgrid(x,y);
u=repmat(2,length(x),7);
v=repmat(1,length(x),7);
quiver(x,y,u,v)
  1 Kommentar
VBBV
VBBV am 30 Mär. 2022
Thanks is accepting answer, please accept answer if it solved your doubt, :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Vector Fields finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by