Ask your own question, for FREE!
Mathematics 11 Online
OpenStudy (bgrg007):

anyone good with calc 3 Matlab? please help!! how can i change the scaling on the x-axis? like it usually goes on multiples of 1's. how can i change that? to maybe multiples of 5 or 10?

OpenStudy (anonymous):

are you using plot(x,y) ?

OpenStudy (bgrg007):

no. ezplot

OpenStudy (bgrg007):

i put >> ezplot(y,[-pi,pi]). so does this mean its already scaled and i just need to relabel the axis into pi and such?

OpenStudy (anonymous):

i've never used ezplot; only plot. there might be an "ez" way to do it in options or something unless you have to use ezplot, i'd recommend doing this way: this is an example in a script i had to produce: plot(t,V); grid on; xlabel('Time [s]'); ylabel(sprintf('Velocity [Volts]')); title({'1.5 Turns - Velocity vs. Time'}); xlim([0 .5]) -------- these 2 define the limits of ylim([-.6 .6]) --------- the window set(gca,'XTick', 0:.1:2); ---- these 2 define the scaling of set(gca,'YTick', -.6:.05:.6); --- the axes (gca, '_Tick', lowest: difference between them:highest) you'll want (gca, 'XTick', 0: use 5 or 10: high end)

OpenStudy (bgrg007):

thx. the thing is for my case, im making a sine and cos graph and they need to be in multiples of pi.

OpenStudy (anonymous):

i'd recommend -pi : pi/4 : pi

OpenStudy (anonymous):

or pi/3, depending on your data

OpenStudy (bgrg007):

whoa. the set(gca command worked. thank you!! :D

OpenStudy (bgrg007):

mm another question if u don't mind. how do i relabel the numbers in the x axis? so right now it says 3.14 and 1.57 and such and i want to change it to pi and pi/2

OpenStudy (anonymous):

only way i know to do this would be manually. so for example: set(gca,'XTick',-pi:pi/2:pi) set(gca,'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'}) we had to manually set all 5 values between -pi and pi

OpenStudy (bgrg007):

it worked. thank you so much! ^__^

OpenStudy (anonymous):

i think adding a backslash will give you the symbol for pi. '-\pi', -\pi/2 ect otherwise there is an ascii pi symbol you can try copy/pasting glad i could help :)

OpenStudy (bgrg007):

wish i could offer u more than a click for 'best response'! >.< you're awesome

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!