??? Attempted to access vv(:,1); index out of bounds because size(vv)=[0,0] - Help?

2 ビュー (過去 30 日間)
Chris Corbett
Chris Corbett 2012 年 12 月 7 日
Hi,I was hoping somebody would be able to help.
I keep getting this error when running this small program and I have absolutely no idea why:
??? Attempted to access vv(:,1); index out of bounds because size(vv)=[0,0].
Error in ==> interpstreamspeed at 104 spdi = interp2(x,y,spd,vv(:,1), vv(:,2));
if true
% x and y values;
clc;
clear all;
x = -19.5:1:19.5;
y = 0.5:1:14.5;
[xgrid ygrid] = meshgrid(x,y);
A = 1;
sx = [-20:1:20];
sy =linspace(10,10,41)
% x Component;
u = A.*(xgrid);
% y Component;
v = A.*(-ygrid);
% Plotting Streamlines;
verts = stream2(xgrid,ygrid,u,v,sx,sy);
streamline(verts)
hold all;
% Plot straight thick lines;
h = plot(x,0,'*k');
set(h,'linewidth',2);
% Animate particles along streamlines;
iverts = interpstreamspeed(xgrid, ygrid, u, v, verts,0.01);
streamparticles(iverts,20,'Animate',2,'FrameRate',100);
end
Could anybody possibly tell me why?
Thank You, Chris
  3 件のコメント
Matt J
Matt J 2012 年 12 月 7 日
Since the error occurs inside interpstreamspeed (according to the messages), you need to show the contents of that function.
Matt Fig
Matt Fig 2012 年 12 月 7 日
Matt J, that function is a MATLAB function.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by