Clear Filters
Clear Filters

how to plot curve in matlab

3 views (last 30 days)
saman ahmadi
saman ahmadi on 5 Sep 2020
Edited: KSSV on 6 Sep 2020
Hi. How can i plot below equation?
thank you very much
f=(31*f^6)/49000000000 - (667*f^2)/39200 - (657*f^4)/98000000 - (375*cos(qa))/28 - (f^2*cos(qa))/400 + (3*f^4*cos(qa))/7000000 + 375/28;
  3 Comments
saman ahmadi
saman ahmadi on 5 Sep 2020
Excuse me, it is below, I want to plot curve(qa vs f). thank you
(31*f^6)/49000000000 - (667*f^2)/39200 - (657*f^4)/98000000 - (375*cos(qa))/28 - (f^2*cos(qa))/400 + (3*f^4*cos(qa))/7000000 + 375/28=0;
David Hill
David Hill on 5 Sep 2020
For each qa there potentailly could be six real solutions for f. How do you want to plot that? You could plot the equation's value for different values of qa. For example:
qa=pi/4;%change qa to desired values.
y=@(f)(31*f.^6)/49000000000 - (667*f.^2)/39200 - (657*f.^4)/98000000 - (375*cos(qa))/28 - (f.^2*cos(qa))/400 + (3*f.^4*cos(qa))/7000000 + 375/28;
f=-115:.01:115;
plot(f,y(f));

Sign in to comment.

Answers (1)

KSSV
KSSV on 6 Sep 2020
Edited: KSSV on 6 Sep 2020
Are you looking for something like this?
qa = linspace(-pi,+pi,200) ; % give your ranges
f= linspace(-115,115,200) ; % give your ranges
[f,qa] = meshgrid(f,qa) ; % for a mesh
y=@(f,qa)(31*f.^6)/49000000000 - (667*f.^2)/39200 - (657*f.^4)/98000000 - (375*cos(qa))/28 - (f.^2.*cos(qa))/400 + (3*f.^4.*cos(qa))/7000000 + 375/28;
y = y(f,qa) ;
contour(f,qa,y,[0 0])

Tags

Community Treasure Hunt

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

Start Hunting!