Ask your own question, for FREE!
Engineering 21 Online
OpenStudy (anonymous):

can someone help me write a program for MATLAB for cos(theta) SO FAR I HAVE: clc clear theta=0:pi:4*pi; plot(theta,cos(theta)) xlabel('theta') ylabel('cos(theta)') grid off for some reason it's display the graph not 'curve' and it's not display the x values a 0,pi,2pi,3pi,4pi... someone help please :/

OpenStudy (anonymous):

for some reason it's display the graph not 'curve' and it's not display the x values a 0,pi,2pi,3pi,4pi... ^ what do you mean?

OpenStudy (anonymous):

give me a sec and I'll upload the problem exactly.. it has a picture..

OpenStudy (anonymous):

Write a MATLAB program that generates the following plot:(Note: you also need to label the x and y axis)

OpenStudy (anonymous):

so far.. i have : clc clear theta=0:pi:4*pi; plot(theta,cos(theta)) xlabel('theta') ylabel('cos(theta)') grid off but it still doesn't look like the plot it gives and i don't know what else to do

OpenStudy (anonymous):

I will try it on my machine

OpenStudy (anonymous):

okay, thank you!

OpenStudy (anonymous):

I see your problems , you needs more values for theta than just 4 values

OpenStudy (anonymous):

how do it do that?

OpenStudy (anonymous):

Try that

OpenStudy (anonymous):

clc clear x = 0:pi/1000:4*pi plot(x,cos(x)) xlabel('theta') ylabel('cos(theta)') grid off

OpenStudy (anonymous):

it's perfect other then the x values don't appear the same as in the picture i uploaded.. you see that?

OpenStudy (anonymous):

yeah, that's what I am looking at too

OpenStudy (anonymous):

try the following

OpenStudy (anonymous):

clc clear x = 0:pi/1000:4*pi theta=0:pi:4*pi plot(x,cos(x)) set(gca,'XTick',0:pi:4*pi) set(gca,'XTickLabel',{'0','pi','2 pi','3 pi',' 4 pi'}) xlabel('theta') ylabel('cos(theta)') grid off

OpenStudy (anonymous):

it's perfect!!! thank you! my goodness you're amazing!

OpenStudy (anonymous):

welcome

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!