MATLAB Answers

0

Error using quiver (line 44) The size of X must match the size of U or the number of columns of U.

Asked by Joyce Vlaming on 18 May 2018 at 13:55

Hello, I have an image of a river (Grids) which I plot using 'imagesc'. This works fine. I want to draw an arrow from say point A to point B. I have the x and y coordinates for both point A and B. So the sizes of all vectors match each other. Still I get the following error: Error using quiver (line 44) The size of X must match the size of U or the number of columns of U. How is can I fix this? Thanks in advance!

if true
  % code figure;
imagesc(Grids);
colormap('gray');
hold on
x = [397 406];
y = [111 137];
uv = y-x;        
quiver(x,y,uv(1),uv(2));
end

  0 Comments

Sign in to comment.

0 Answers

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today