vertlabels.m

来自「ipr函数库与仿真实验程序,都是要用到的库函数。」· M 代码 · 共 30 行

M
30
字号
function vertlabels(curr_axis,labels)%% This function adds vertical labels to a plot %%%%%%%%%%%%%%%%% vertlabels.m %%%%%%%%%%%%%%%%%%%   Discrete-Time Control Problems using        %%       MATLAB and the Control System Toolbox   %%   by J.H. Chow, D.K. Frederick, & N.W. Chbat  %%         Brooks/Cole Publishing Company        %%                September 2002                 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%numTicks=size(labels,1);% Set the tick locations and remove the labelsset(curr_axis,'XTick',1:numTicks,'XTickLabel','')%% Estimate the location of the labels based on the position% of the xlabelhx = get(curr_axis,'XLabel');  		% Handle to xlabelset(hx,'Units','data');pos = get(hx,'Position');y = pos(2);% Place the new labelsfor i = 1:numTicks  txt(i) = text(i,y,labels(i,:));endset(txt,'Rotation',90,'HorizontalAlignment','right')%%%%%%%%%%

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?