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?
are you using plot(x,y) ?
no. ezplot
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?
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)
thx. the thing is for my case, im making a sine and cos graph and they need to be in multiples of pi.
i'd recommend -pi : pi/4 : pi
or pi/3, depending on your data
whoa. the set(gca command worked. thank you!! :D
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
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
it worked. thank you so much! ^__^
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 :)
wish i could offer u more than a click for 'best response'! >.< you're awesome
Join our real-time social learning platform and learn together with your friends!