Follow up questions to original.

조회 수: 2 (최근 30일)
Byronb
Byronb 2016년 4월 29일
답변: Ilham Hardy 2016년 4월 29일
Original question: http://au.mathworks.com/matlabcentral/answers/281617-i-am-having-some-issues-calling-a-function-in-a-script-file One more question if you or anyone is still looking at this. In the original function the n number of outputs are arranged so that the index of the first is assigned to 1 on the plot created with my script. However since i'm dealing with populations I need this 'initial' value to be assigned to 0 on the plot. Or in other words, for every y value I have, the x value needs to decrease by 1. So my graph will be translated left 1 unit.

답변 (1개)

Ilham Hardy
Ilham Hardy 2016년 4월 29일
After you create your plot, create your own x-axis (or y-axis) label using
xticklabel
e.g.
plot(1:4)
grid on
set(gca,'Xtick',1:4,'XTickLabel',{'a', 'b', 'c', 'd'})
Hope that helps

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by