How can I plot This ?

I have : x= [ 0.2 :0.1 : 0.6 ] and y = 4 * (sqrt(1 - x.^2)) / (2*pi*x)
I need to plot This equation for the interval of x from 0.2 to 0.6 ,and it aint working for me !!!
please help ,, thank you

댓글 수: 2

LK K
LK K 2013년 5월 30일
This shoul have worked ,, but it didnt :
for x = [ 0.2 :0.1 :0.6] y = 4 * (sqrt(1 - x.^2)) / (2*pi*x) plot (x,y) end !!
José-Luis
José-Luis 2013년 5월 30일
No, what it did is that it did not work as you expected. You are always erasing the previous plot if you do not use hold on. And even if you did, you would have plotted some points, not a line.
Please accept an answer if it helped you. Please look at the documentation on the plot function
doc plot
doc hold

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

답변 (2개)

Wayne King
Wayne King 2013년 5월 30일

0 개 추천

x = 0.2:0.01:0.6;
y = 4*(sqrt(1-x.^2))./(2*pi*x);
plot(x,y)
You should always post your code.
José-Luis
José-Luis 2013년 5월 30일

0 개 추천

What does "it ain't working" mean?
x= [ 0.2 :0.1 : 0.6 ] ;
y = 4 * (sqrt(1 - x.^2)) ./ (2*pi.*x);
plot(x,y);

카테고리

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

태그

질문:

2013년 5월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by