How to plot cos(x)^4/(1-0.5cos(x))^6 between 0 and 90 degrees

2 views (last 30 days)
Have attempted this but gives error regarding matrices, could someone tell me the error in my code? Did it in one line at y = , but gives y as single value so can't be plotted.
x = (0:1:90)
a = cos(x).^4
b = (1-0.5*cos(x)).^6
y = a/b
plot(x,y,'k+-')

Accepted Answer

Birdman
Birdman on 9 Mar 2018
Edited: Birdman on 9 Mar 2018
You need to do elementwise operation. Try this:
x=0:0.01:pi/2;
y=cos(x).^4./(1-0.5*cos(x)).^6;
plot(180*x/pi,y)

More Answers (0)

Community Treasure Hunt

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

Start Hunting!