How can I draw hysteresis loop using matlab

I have velocity ,v, and discharge, q, vectors . I want to draw hysteresis plot between the two. I used plot_dir function but it can't allow me to have the plot with good view and resolution. Is there any way of plotting it?
I used this function but failed
plot_dir(v,q)
Thanks for your help.
Any function that give that shows the beginning and end of successive points with arrow is acceptable. Thanks again.

 채택된 답변

José-Luis
José-Luis 2013년 2월 13일
편집: José-Luis 2013년 2월 13일

0 개 추천

x = rand(10,1);
y = rand(10,1);
quiver(x(1:end-1),y(1:end-1),diff(x),diff(y),0);
Please accept an answer if it helps you.

댓글 수: 5

X = [-3:.2:3 3:-.2:-3];
Y = [tanh(X(1:length(X)/2)-1) tanh(X(length(X)/2+1:end)+1)];
patch(X,Y,[.5 1 .5]); hold on
quiver(X(1:end-1),Y(1:end-1),diff(X),diff(Y),0);
José-Luis
José-Luis 2013년 2월 13일
@ChristianW: showing off? :-)
ChristianW
ChristianW 2013년 2월 13일
Well, all I read were 2 words hysteresis and arrow. So I guess its a patch + a quiver whats needed.
Nice!
Ede gerlderlands
Ede gerlderlands 2013년 2월 13일
편집: Ede gerlderlands 2013년 2월 13일
Thanks all, You answered my questions . the arrow direction is not really distinguishable is there any way of improving it? it looks straight line rather than arrow...tnx

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by