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

3 vues (au cours des 30 derniers jours)
Mustafa Shahid
Mustafa Shahid le 26 Mar 2022
Commenté : VBBV le 30 Mar 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.

Réponse acceptée

VBBV
VBBV le 26 Mar 2022
Modifié(e) : VBBV le 26 Mar 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 commentaire
VBBV
VBBV le 30 Mar 2022
Thanks is accepting answer, please accept answer if it solved your doubt, :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Vector Fields dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by