reference vector

classic Classic list List threaded Threaded
7 messages Options
saroj saroj
Reply | Threaded
Open this post in threaded view
|

reference vector

How to show a reference vector while showing some velocity distribution. For Example, I am analyzing surface velocity distribution in a laboratory channel flow. And I plotted velocity distribution but I cannot show a reference vector of my distribution. Please can anyone help me on this.
William William
Reply | Threaded
Open this post in threaded view
|

Re: reference vector

With "reference vector" you mean a reference for the length of the vectors of the data?

Please consider donating for the PIVlab project:
http://paypal.me/pools/c/81Y8wBVi4y

The developer needs to update to a recent Matlab release in order to keep the project running.

saroj saroj
Reply | Threaded
Open this post in threaded view
|

Re: reference vector

Dear William,

Yes. I mean the length of the vector for reference.
saroj saroj
Reply | Threaded
Open this post in threaded view
|

Re: reference vector



Please see this image for example.
William William
Reply | Threaded
Open this post in threaded view
|

Re: reference vector

You could try to add it manually after PIVlab finished the calculation:
When PIVlab is finishedwith the result, go to the command window of Matlab and type:

hold on
quiver(1,1,1,0) %xpos, ypos, u, v
hold off

That will display a vector with the length 1 at the position 1,1. I think this might work. Search the matlab documentation for "quiver" if you want to change the appearance of the vector.


I might consider to add the reference vector in PIVlab in a next release.

Please consider donating for the PIVlab project:
http://paypal.me/pools/c/81Y8wBVi4y

The developer needs to update to a recent Matlab release in order to keep the project running.

saroj saroj
Reply | Threaded
Open this post in threaded view
|

Re: reference vector

Thank you, William!

I tried this command but the arrow plot is generated on a new window. I want to have the reference arrow in the same window where I made the PIV analysis. Is it Possible?
William William
Reply | Threaded
Open this post in threaded view
|

Re: reference vector

This code will work. Just enter it in the command window after the analysis finished:

Me wrote
%read current vector scaling setting from PIVlab
A=getappdata(0,'hgui');
handles=guihandles(A);
vecscale=str2num(get(handles.vectorscale,'string'));

%Warn if vector autoscale is enabled
if get(handles.autoscale_vec, 'Value') == 1
disp('You need to disable auto-scale in PIVlab! (Plot --> Modify Plot Appearance)')
end


%Hold the display of PIVlab
hold(A.CurrentAxes,'on')
quiver(10,10,4*vecscale,0,'Parent',A.CurrentAxes,'Color','r','Linewidth',4)

Please consider donating for the PIVlab project:
http://paypal.me/pools/c/81Y8wBVi4y

The developer needs to update to a recent Matlab release in order to keep the project running.