MATLAB: How to let y-axis ticks increase by 2 MATLABticks How to let y-axis ticks increase by 2? The number on the y-axis should also be in 2 decimal places. What codes will I use? Best Answer Look at thist=0:0.001:10;y=12.5*sin(t)plot(t,y)yt=get(gca,'ylim')nyt=yt(1):2:yt(2)ytl=cellfun(@(x) sprintf('%.2f',x),num2cell(nyt),'un',0)set(gca,'ytick',nyt,'yticklabel',ytl) Related SolutionsMATLAB: Reshape array 3 variables into 2 B = squeeze(A)orB = permute(A,[2,3,1]);orB = reshape(A,size(A,2),[]); MATLAB: My function gives me one output instead of 2 Call your function with two outputs. Related QuestionHow to save full size image in axes 2Does gradient function calculate wrong dimensions 1 and 2Code to accept 2 numbers and to display armstrong number between the 2
Best Answer