The streamline/streamslice gave me an error stating that U,V should be 3D data. How can I make those in 3D?
how to plot streamline
18 次查看(过去 30 天)
显示 更早的评论
I have the 2-D PIV data like below and I am not able to get streamlines in matlab:
ix,iy,iz = image coordinate X,Y,Z [pixel]
dx = displacement component X [pixel] * (image resoltion) = mm
dy = displacement component Y [pixel] * (image resoltion) = mm
--------------------------------------------------
So I have dx and dy in mm. Also I can calculate: du = dx/dt , dv = dy/dt as the velocities in x and y directions.
I want to get the streamline usnig streamline/streamslice functions in matlab but I do not know how to define startx and starty?? Should I use meshgrid function for that? and shoul I use ix,iy(image coordinates) OR dx,dy to define startx and starty points?
Moreover do I need to define meshgrid for du,dv to fill velocities for every point??
Any help would be appreciated.
A = xlsread(......myfile.xls); % myfile.xls contains all data.
dx = A(1:end,4); % size(dx) = 8400*1
dy = A(1:end,5); % size(dy) = 8400*1
du = A(1:end,6); % size(du) = 8400*1
dv = A(1:end,7); % size(dv) = 8400*1
[startx,starty] = ?????
[X,Y] = meshgrid(dx,dy);
streamline(X,Y,du,dy,startx,starty);
采纳的回答
KSSV
2021-7-14
编辑:KSSV
2021-7-14
Try:
skip = 2 ; % can be changed
startx = X(1:skip:end,1:skip:end) ;
starty = Y(1:skip:end,1:skip:end) ;
streamline(X,Y,du,dy,startx,starty);
Also have a look on streamslice. This would be a better function to use.
11 个评论
KSSV
2021-7-19
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/687023/ane1_data.xlsx.xlsx') ;
T(8447,:) =[] ; % remove NaNs
x = T.(1) ; y = T.(2) ;
dx = T.(4) ; dy = T.(5) ;
[X,Y] = meshgrid(linspace(min(x),max(x)),linspace(min(y),max(y))) ;
dX = griddata(x,y,dx,X,Y) ;
dY = griddata(x,y,dy,X,Y) ;
streamline(X,Y,dX,dY,X,Y)
And thanks is accepting/ voting the answer.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Volume Visualization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!