getlinespecs.m

来自「Continuous Profile Models (CPM) Matlab T」· M 代码 · 共 62 行

M
62
字号
%function linespecs = getLineSpecs(whatType)%% Returns a matrix of different line specs to be used when% iteratively plotting on the same graph.% 'whatType'=0 gives only marker points% 'whatType'=1 gives lined/marker plots% 'whatType'=2 gives line only plots%% default is whatType=1function linespecs = getLineSpecs(whatType)if (~exist('whatType'))  whatType=0;endmycolours = {'b' 'r','k','g','m'};%,'y'};mylines = {'-','--',':'};mymark = {'^','o','x','+','<','>','p','h','d','v','s','.','*'};nxt=1;clear linespecs;if (whatType==1)    for ln=1:length(mylines)        for mk=1:length(mymark)            for cl=1:length(mycolours)                linespecs{nxt}= [mycolours{cl} mymark{mk} mylines{ln}];                nxt=nxt+1;            end        end    endelseif (whatType==2)    for ln=1:length(mylines)        for cl=1:length(mycolours)            linespecs{nxt}= [mycolours{cl} mylines{ln}];            nxt=nxt+1;        end    endelseif (whatType==0)    for mk=1:length(mymark)        for cl=1:length(mycolours)            linespecs{nxt}= [mycolours{cl} mymark{mk}];            nxt=nxt+1;        end    endend%% have it cycle around in case need a huge number%% lightspeed causes this to crash now%linespecs = repmat(linespecs, [1 50]);for j=1:5    N=length(linespecs);    linespecs((end+1):(end+N))=linespecs;endreturn;

⌨️ 快捷键说明

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