0001 function cmatplotcmatplot(in1,in2,in3,in4,in5)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 ni = nargin;
0042 no = nargout;
0043 error(nargchk(1,5,ni));
0044
0045 if ni == 1
0046 F=in1;
0047 method=[];
0048 ux=[]; uy=[];
0049 clevels=[];
0050 elseif ni == 2
0051 F=in1;
0052 method = in2;
0053 ux=[]; uy=[];
0054 clevels=[];
0055 elseif ni == 3
0056 ux=in1;
0057 uy=in2;
0058 F=in3;
0059 method=[];
0060 clevels=[];
0061 elseif ni == 4
0062 ux=in1;
0063 uy=in2;
0064 F=in3;
0065 method=in4;
0066 clevels=[];
0067 elseif ni == 5
0068 ux=in1;
0069 uy=in2;
0070 F=in3;
0071 method=in4;
0072 clevels=in5;
0073 else
0074 error('Wrong number of input arguments.');
0075 end
0076
0077 if isempty(method)
0078 method = 1;
0079 end
0080
0081
0082
0083
0084
0085
0086
0087 if iscell(F)
0088 [N,M] = size(F);
0089 for i=1:N
0090 for j=1:M
0091 subplot(N,M,(i-1)*M+j)
0092 cmatplot(ux,uy,F{i,j},method,clevels);
0093 end
0094 end
0095
0096 else
0097
0098 if isempty(ux)
0099 ux =(1:size(F,2));
0100 end
0101 if isempty(uy)
0102 uy =(1:size(F,1));
0103 end
0104
0105
0106 ux = ux(:)';
0107 uy = uy(:)';
0108
0109 n = length(F);
0110
0111 if method == 1
0112 F = flipud(F');
0113 mesh(ux,fliplr(uy),F)
0114 xlabel('min')
0115 ylabel('Max')
0116 view(-37.5-90,30)
0117 v = axis; axis([min(ux) max(ux) min(uy) max(uy) v(5:6)]);
0118 elseif method == 2
0119 F = flipud(F');
0120 surf(ux,fliplr(uy),F)
0121 xlabel('min')
0122 ylabel('Max')
0123 view(-37.5-90,30)
0124 v = axis; axis([min(ux) max(ux) min(uy) max(uy) v(5:6)]);
0125 elseif method == 3
0126 F = flipud(F');
0127 F1 = [F zeros(length(uy),1); zeros(1,length(ux)+1)];
0128 F2 = F1; F2(F2==0)=NaN;
0129 F1 = F2;
0130 dx=ux(2)-ux(1); dy=uy(2)-uy(1);
0131 ux1 = [ux ux(length(ux))+dx] - dx/2;
0132 uy1 = [uy uy(length(uy))+dy] - dy/2;
0133 pcolor(ux1,fliplr(uy1),F1)
0134 xlabel('min')
0135 ylabel('Max')
0136 v = axis; axis([min(ux1) max(ux1) min(uy1) max(uy1)]);
0137 axis('square')
0138 elseif method == 4
0139 F = flipud(F');
0140 if isempty(clevels)
0141 Fmax=max(max(F));
0142 clevels=Fmax*[0.005 0.01 0.02 0.05 0.1 0.2 0.4 0.6 0.8];
0143 end
0144 contour(ux,fliplr(uy),F,clevels)
0145 xlabel('min')
0146 ylabel('Max')
0147 v = axis; axis([min(ux) max(ux) min(uy) max(uy)]);
0148 axis('square')
0149
0150
0151
0152
0153
0154
0155
0156 if 1==2
0157 clevels=sort(clevels);
0158 n_clevels=length(clevels);
0159 if n_clevels>12
0160 disp(' Only the first 12 levels will be listed in table.')
0161 n_clevels=12;
0162 end
0163
0164 textstart_x=0.65;
0165 textstart_y=0.45;
0166 delta_y=1/33;
0167 h=figtext(textstart_x,textstart_y,'Level curves at:','norm');
0168 set(h,'FontWeight','Bold')
0169
0170 textstart_y=textstart_y-delta_y;
0171
0172 for i=1:n_clevels
0173 textstart_y=textstart_y-delta_y;
0174 figtext(textstart_x,textstart_y,num2str(clevels(i)),'norm')
0175 end
0176 end
0177
0178 elseif method == 5 | method == 15
0179
0180 if isempty(clevels)
0181 Fmax=max(max(F));
0182 clevels=Fmax*[0.001 0.005 0.01 0.05 0.1 0.5 1.0];
0183 end
0184 v=clevels;
0185
0186 sym = '...x+***';
0187 sz = [6 20 24 8 8 8 12 16]
0188
0189
0190 for i = 1:length(v)
0191 plot(-1,-1,sym(i),'markersize',sz(i)),hold on
0192 end
0193
0194 for i = 1:length(v)-1
0195 Ind = (F>v(i)) & (F<=v(i+1));
0196 [I,J] = find(Ind);
0197
0198 plot(I,J,sym(i),'markersize',sz(i)),hold on
0199 end
0200 plot([1 n],[1 n],'--'), grid
0201 hold off
0202
0203 axis([0.5 n+0.5 0.5 n+0.5])
0204
0205
0206
0207
0208 legendText=num2str(v(1:end)')
0209
0210 legend(legendText,-1)
0211
0212 title('From-To plot')
0213 xlabel('To / Standing')
0214 ylabel('From / Hanging')
0215
0216 if method == 15
0217 axis('ij');
0218 end
0219
0220 elseif method == 11
0221
0222 mesh(ux,uy,F)
0223 axis('ij');
0224 xlabel('To')
0225 ylabel('From')
0226 view(-37.5-90,30)
0227 v = axis; axis([min(ux) max(ux) min(uy) max(uy) v(5:6)]);
0228
0229 elseif method == 12
0230
0231 surf(ux,uy,F)
0232 axis('ij');
0233 xlabel('To')
0234 ylabel('From')
0235 view(-37.5-90,30)
0236 v = axis; axis([min(ux) max(ux) min(uy) max(uy) v(5:6)]);
0237
0238 elseif method == 13
0239
0240 F1 = [F zeros(length(uy),1); zeros(1,length(ux)+1)];
0241 F2 = F1; F2(F2==0)=NaN;
0242 F1 = F2;
0243 dx=ux(2)-ux(1); dy=uy(2)-uy(1);
0244 ux1 = [ux ux(length(ux))+dx] - dx/2;
0245 uy1 = [uy uy(length(uy))+dy] - dy/2;
0246 axis('ij');
0247 pcolor(ux1,uy1,F1)
0248 axis('ij');
0249 xlabel('To')
0250 ylabel('From')
0251 v = axis; axis([min(ux1) max(ux1) min(uy1) max(uy1)]);
0252 axis('square')
0253
0254 elseif method == 14
0255 if isempty(clevels)
0256 Fmax=max(max(F));
0257 clevels=Fmax*[0.005 0.01 0.02 0.05 0.1 0.2 0.4 0.6 0.8];
0258 end
0259 contour(ux,uy,F,clevels)
0260 axis('ij');
0261 xlabel('To')
0262 ylabel('From')
0263 v = axis; axis([min(ux) max(ux) min(uy) max(uy)]);
0264 axis('square')
0265
0266
0267
0268
0269
0270
0271
0272 if 1==1
0273 clevels=sort(clevels);
0274 n_clevels=length(clevels);
0275 if n_clevels>12
0276 disp(' Only the first 12 levels will be listed in table.')
0277 n_clevels=12;
0278 end
0279
0280 textstart_x=0.10;
0281 textstart_y=0.45;
0282 delta_y=1/33;
0283 h=figtext(textstart_x,textstart_y,'Level curves at:','norm');
0284 set(h,'FontWeight','Bold')
0285
0286 textstart_y=textstart_y-delta_y;
0287
0288 for i=1:n_clevels
0289 textstart_y=textstart_y-delta_y;
0290 figtext(textstart_x,textstart_y,num2str(clevels(i)),'norm')
0291 end
0292 end
0293
0294 elseif method == 15
0295
0296
0297
0298
0299
0300
0301
0302
0303
0304
0305
0306
0307
0308
0309
0310
0311
0312
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322 end
0323
0324 end
0325