Im trying to make a graph of the locations of particles as they change over time but whenever I use scatter it gives me the error X and Y must be vectors of the same length Im sure its something simple, im not that good at matlab

4 commentaires

KSSV
KSSV le 3 Mai 2018
Your Xx and Xy are matrices......you want to plot a surface? Or what you are expecting?
KSSV
KSSV le 3 Mai 2018
Dude..you need reconsider your code.......
fx = 6.*pi.*rho_f*v.*R.*(u-u_p);
u_p is of size 1600*1.
Stephen23
Stephen23 le 15 Nov 2019
Original question by Joseph Stocken "I'm trying to make a graph of the location of a particle but it keeps giving me the error X and Y must be the same length":
Im trying to make a graph of the locations of particles as they change over time but whenever I use scatter it gives me the error X and Y must be vectors of the same length Im sure its something simple, im not that good at matlab
Képkivágás.PNG
Rena Berman
Rena Berman le 12 Déc 2019
(Answers Dev) Restored edit

Connectez-vous pour commenter.

 Réponse acceptée

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy le 3 Mai 2018

1 vote

In your code, X and Y are not vector. It is matrix with size 1600 x 7. You can use below comment.
if true
scatter(Xx(:,7),Xy(:,7))
end

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by