Home > applications > loco > locoplot.m

locoplot

PURPOSE ^

LOCOPLOT - Subroutines for plotting LOCO output

SYNOPSIS ^

function ElementsInput = locoplot(FileName, IterationNumber, PlotString, PlaneString, ElementsInput)

DESCRIPTION ^

LOCOPLOT - Subroutines for plotting LOCO output
  locoplot(FileName, IterationNumber, PlotString, PlaneString, Elements)
  locoplot({BPMData, CMData, LocoMeasData, LocoModel, FitParameters, LocoFlags, RINGData}, IterationNumber, PlotString, PlaneString, Elements)

  INPUTS
  1. FileName = data file name
  2. IterationNumber = 0, 1, 2, etc
       or
  1. BPMData
  2. CMData
  3. LocoMeasData
  4. LocoModel
  5. FitParameters
  6. LocoFlags
  7. RINGData

  What data to plot:
     PlotString = 'Model', 'Measured', 'Model-Measured', , 'Model-Measured+EnergyShifts'

  For 3-D surf plots of the entire response matrix:
     PlaneString = 'XX', 'YY', 'XY', 'YX', 'All' 

  For 2-D row (BPM) or column (CM) plots:
     PlaneString = 'HBPM', 'VBPM', 'HCM', 'VCM'
     Elements = element number within the response matrix (based on HBPMIndex,VBPMIndex,HCMIndex,VCMIndex) 

  Written by Greg Portmann

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function ElementsInput = locoplot(FileName, IterationNumber, PlotString, PlaneString, ElementsInput)
0002 %LOCOPLOT - Subroutines for plotting LOCO output
0003 %  locoplot(FileName, IterationNumber, PlotString, PlaneString, Elements)
0004 %  locoplot({BPMData, CMData, LocoMeasData, LocoModel, FitParameters, LocoFlags, RINGData}, IterationNumber, PlotString, PlaneString, Elements)
0005 %
0006 %  INPUTS
0007 %  1. FileName = data file name
0008 %  2. IterationNumber = 0, 1, 2, etc
0009 %       or
0010 %  1. BPMData
0011 %  2. CMData
0012 %  3. LocoMeasData
0013 %  4. LocoModel
0014 %  5. FitParameters
0015 %  6. LocoFlags
0016 %  7. RINGData
0017 %
0018 %  What data to plot:
0019 %     PlotString = 'Model', 'Measured', 'Model-Measured', , 'Model-Measured+EnergyShifts'
0020 %
0021 %  For 3-D surf plots of the entire response matrix:
0022 %     PlaneString = 'XX', 'YY', 'XY', 'YX', 'All'
0023 %
0024 %  For 2-D row (BPM) or column (CM) plots:
0025 %     PlaneString = 'HBPM', 'VBPM', 'HCM', 'VCM'
0026 %     Elements = element number within the response matrix (based on HBPMIndex,VBPMIndex,HCMIndex,VCMIndex)
0027 %
0028 %  Written by Greg Portmann
0029 
0030 if ~nargin == 5
0031     error('Requires 5 inputs (see help locoplot).');
0032 end
0033 
0034 if isempty(FileName)
0035     return;
0036 end
0037 
0038 if iscell(FileName)
0039     BPMData       = FileName{1};
0040     CMData        = FileName{2};
0041     LocoMeasData  = FileName{3};
0042     LocoModel     = FileName{4};
0043     FitParameters = FileName{5};
0044     LocoFlags     = FileName{6};
0045     RINGData      = FileName{7};
0046 elseif isstr(FileName)    
0047     try
0048         load(FileName);
0049     catch
0050         fprintf('   LOCOPLOT:  File does not exist or is not a *.mat file type.\n'); return;
0051     end    
0052 else
0053     error('Input problem');
0054 end
0055 
0056 legend off
0057 
0058 if length(BPMData) > 1
0059     IterationNumber = IterationNumber + 1;
0060     if IterationNumber > length(BPMData)
0061         fprintf('   LOCOPLOT:  The data file only has %d iterations.  Hence, the input InterationNumber cannot be %d.\n', length(BPMData)-1, IterationNumber-1);
0062         return
0063     end
0064     
0065     BPMData = BPMData(IterationNumber);
0066     CMData = CMData(IterationNumber);
0067     LocoModel = LocoModel(IterationNumber);
0068     FitParameters = FitParameters(IterationNumber);
0069     LocoFlags = LocoFlags(IterationNumber);
0070 end
0071 
0072 % if isempty(LocoModel.M)
0073 %     fprintf('   LOCOPLOT:  Model data is empty.\n');
0074 %     return;
0075 % end
0076 if isempty(LocoMeasData.M)
0077     fprintf('   LOCOPLOT:  Measured data is empty. \n'); 
0078     return;
0079 end
0080 
0081 Mmodel = LocoModel.M;
0082 
0083 Outliers = LocoModel.OutlierIndex;
0084 
0085 Mmeas = LocoMeasData.M;
0086 Mmeas = Mmeas([BPMData.HBPMGoodDataIndex(:)' length(BPMData.HBPMIndex)+BPMData.VBPMGoodDataIndex(:)'], [CMData.HCMGoodDataIndex(:)' length(CMData.HCMIndex)+CMData.VCMGoodDataIndex(:)']); 
0087 
0088 NHBPM = length(BPMData.HBPMGoodDataIndex);
0089 NVBPM = length(BPMData.VBPMGoodDataIndex);
0090 NBPM  = NHBPM + NVBPM;
0091 NHCM = length(CMData.HCMGoodDataIndex);
0092 NVCM = length(CMData.VCMGoodDataIndex);
0093 
0094 % Mark the outliers with NaN
0095 if isempty(Mmodel)
0096     Mmodel = NaN * Mmeas;
0097 else
0098     Mmodel = Mmodel(:);
0099     Mmodel(Outliers) = NaN; 
0100     Mmodel = reshape(Mmodel,  NBPM, NHCM+NVCM);
0101 end
0102 
0103 if strcmp(lower(PlotString),'model')
0104     data = Mmodel;
0105 elseif strcmp(lower(PlotString),'measured')
0106     data = Mmeas;
0107 elseif strcmp(lower(PlotString),'model-measured')
0108     data = Mmodel-Mmeas;
0109 elseif strcmp(lower(PlotString),'model-measured+energyshifts')
0110     %[Model, Meas] = locodata(FileName, IterationNumber-1, 'ResponseMatrix', 'Model+EnergyShift', 'ResponseMatrix', 'Meas');
0111     
0112     % Add the dispersion term (measured) to the model response matrix
0113     HCMEnergyShift = CMData.HCMEnergyShift(CMData.HCMGoodDataIndex);
0114     VCMEnergyShift = CMData.VCMEnergyShift(CMData.VCMGoodDataIndex);
0115     
0116     % Set the lattice model
0117     for j = 1:length(FitParameters.Params)
0118         RINGData = locosetlatticeparam(RINGData, FitParameters.Params{j}, FitParameters.Values(j));
0119     end
0120     AlphaMCF = locomcf(RINGData);
0121     EtaXmcf = -AlphaMCF * LocoMeasData.RF * LocoMeasData.Eta(BPMData.HBPMGoodDataIndex) / LocoMeasData.DeltaRF;
0122     EtaYmcf = -AlphaMCF * LocoMeasData.RF * LocoMeasData.Eta(length(BPMData.HBPMIndex)+BPMData.VBPMGoodDataIndex) / LocoMeasData.DeltaRF;
0123     
0124     for i = 1:length(HCMEnergyShift)
0125         Mmodel(:,i) = Mmodel(:,i) + HCMEnergyShift(i) * [EtaXmcf; EtaYmcf];
0126     end
0127     
0128     for i = 1:length(VCMEnergyShift)
0129         Mmodel(:,NHCM+i) = Mmodel(:,NHCM+i) + VCMEnergyShift(i) * [EtaXmcf; EtaYmcf];
0130     end
0131     data = Mmodel-Mmeas;
0132 else
0133     error('   PlotString unknown type.');
0134 end
0135 
0136 PlaneString = upper(PlaneString);
0137 
0138 if strcmp(PlaneString,'XX') | strcmp(PlaneString,'YY') | strcmp(PlaneString,'YX') | strcmp(PlaneString,'XY') | strcmp(PlaneString,'ALL')
0139     % 3-D Plots
0140     if strcmp(PlaneString,'XX')
0141         % XX
0142         [X,Y] = meshgrid(BPMData.HBPMGoodDataIndex, CMData.HCMGoodDataIndex);
0143         surf(X, Y, data(1:NHBPM,1:NHCM)');
0144         ylabel('HCM #');
0145         xlabel('HBPM #');
0146         
0147     elseif strcmp(PlaneString,'YY')
0148         % YY
0149         [X,Y] = meshgrid(BPMData.VBPMGoodDataIndex, CMData.VCMGoodDataIndex);
0150         surf(X, Y, data(NHBPM+1:NHBPM+NVBPM,NHCM+1:NHCM+NVCM)');
0151         ylabel('VCM #');
0152         xlabel('VBPM #');
0153     elseif strcmp(PlaneString,'XY')
0154         % XY
0155         [X,Y] = meshgrid(BPMData.HBPMGoodDataIndex, CMData.VCMGoodDataIndex);
0156         surf(X, Y, data(1:NHBPM,NHCM+1:NHCM+NVCM)');
0157         ylabel('VCM #');
0158         xlabel('HBPM #');
0159         
0160     elseif strcmp(PlaneString,'YX')
0161         % YX
0162         [X,Y] = meshgrid(BPMData.VBPMGoodDataIndex, CMData.HCMGoodDataIndex);
0163         surf(X, Y, data(NHBPM+1:NHBPM+NVBPM,1:NHCM)');
0164         ylabel('HCM #');
0165         xlabel('VBPM #');
0166     elseif strcmp(PlaneString,'ALL')
0167         % All
0168         surf(data');
0169         %ylabel('CM''s');
0170         %xlabel('BPM''s');
0171         
0172         % Change label to BPM numbers
0173         [Ny,Nx] = size(data');
0174         Ticks = 1:ceil(Nx/10):Nx;
0175         set(gca, 'XTick', Ticks);      
0176         TickNumber = [BPMData.HBPMGoodDataIndex(:)' BPMData.VBPMGoodDataIndex(:)'];
0177         TickNumber = TickNumber(Ticks);
0178         set(gca, 'XTickLabel', num2cell(TickNumber));         
0179         xlabel('HBPM# and VBPM#');
0180 
0181         % Change label to HCM and VCM numbers
0182         Ticks = 1:ceil(Ny/10):Ny;
0183         set(gca, 'YTick', Ticks);      
0184         TickNumber = [CMData.HCMGoodDataIndex(:)' CMData.VCMGoodDataIndex(:)'];
0185         TickNumber = TickNumber(Ticks);
0186         set(gca, 'YTickLabel', num2cell(TickNumber));         
0187         ylabel('HCM# and VCM#');
0188     else
0189         fprintf('   LOCOPLOT:  PlaneString unknown. \n'); 
0190         return;        
0191     end
0192     
0193     
0194     if strcmp(lower(PlotString),'model')
0195         title('Model Response Matrix');
0196         zlabel('[mm]');
0197     elseif strcmp(lower(PlotString),'measured')
0198         title('Measured Response Matrix');
0199         zlabel('[mm]');
0200     elseif strcmp(lower(PlotString),'model-measured')
0201         title('Model - Measured Response Matrix');
0202         zlabel('Error [mm]');
0203     elseif strcmp(lower(PlotString),'model-measured+energyshifts')
0204         title('Model-Measured+EnergyShifts Response Matrix');
0205         zlabel('Error [mm]');
0206     end
0207     
0208     % For some reason axis tight has a problem with 3-D plots with only NaN's
0209     if ~all(isnan(data))
0210         axis tight
0211     end
0212 end
0213 
0214 
0215 % 2-D plots
0216 
0217 if strcmp(PlaneString,'HBPM')
0218     BPMData.BPMIndex = BPMData.BPMIndex(:);
0219     if ~exist('ElementsInput','var')
0220         ElementsInput = locoeditlist([BPMData.HBPMGoodDataIndex(:) BPMData.BPMIndex(BPMData.HBPMIndex(BPMData.HBPMGoodDataIndex))], PlaneString, zeros(length(BPMData.HBPMGoodDataIndex),1));
0221         if isempty(ElementsInput)
0222             return
0223         end
0224         ElementsInput = ElementsInput(:,1)';
0225     end
0226     if isempty(ElementsInput)
0227         ElementsInput = locoeditlist([BPMData.HBPMGoodDataIndex(:) BPMData.BPMIndex(BPMData.HBPMIndex(BPMData.HBPMGoodDataIndex))], PlaneString, zeros(length(BPMData.HBPMGoodDataIndex),1));
0228         if isempty(ElementsInput)
0229             return
0230         end
0231         ElementsInput = ElementsInput(:,1)';
0232     end
0233     
0234     % Convert to elements in the HBPMGoodDataIndex vector
0235     [tmp1, tmp2, Elements] = intersect(ElementsInput, BPMData.HBPMGoodDataIndex);
0236     
0237     if ~isempty(Elements)
0238         plot(data(Elements,:)');
0239         
0240         % Change label to HCM and VCM numbers
0241         N = NHCM + NVCM;
0242         Ticks = 1:ceil(N/10):N;
0243         set(gca, 'XTick', Ticks);      
0244         TickNumber = [CMData.HCMGoodDataIndex(:)' CMData.VCMGoodDataIndex(:)'];
0245         TickNumber = TickNumber(Ticks);
0246         set(gca, 'XTickLabel', num2cell(TickNumber));         
0247         xlabel('Horizontal and Vertical Corrector Magnets');
0248         
0249         if strcmp(lower(PlotString),'model')
0250             title('Model Response Matrix');
0251             if length(Elements) == 1
0252                 ylabel(sprintf('Horizontal BPM(%d) [mm]', BPMData.HBPMGoodDataIndex(Elements)));
0253             else
0254                 ylabel('Horizontal BPM [mm]');
0255             end
0256         elseif strcmp(lower(PlotString),'measured')
0257             title('Measured Response Matrix');
0258             if length(Elements) == 1
0259                 ylabel(sprintf('Horizontal BPM(%d) [mm]', BPMData.HBPMGoodDataIndex(Elements)));
0260             else
0261                 ylabel('Horizontal BPM [mm]');
0262             end
0263         elseif strcmp(lower(PlotString),'model-measured')
0264             title('Model - Measured Response Matrix');
0265             if length(Elements) == 1
0266                 ylabel(sprintf('Horizontal Error BPM(%d) [mm]', BPMData.HBPMGoodDataIndex(Elements)));
0267             else
0268                 ylabel('Horizontal BPM Error [mm]');
0269             end
0270         elseif strcmp(lower(PlotString),'model-measured+energyshifts')
0271             title('Model-Measured+EnergyShifts Response Matrix');
0272             if length(Elements) == 1
0273                 ylabel(sprintf('Horizontal Error BPM(%d) [mm]', BPMData.HBPMGoodDataIndex(Elements)));
0274             else
0275                 ylabel('Horizontal BPM Error [mm]');
0276             end
0277         end
0278         
0279         % Only put a legend up to size 10
0280         if length(Elements)>1 & length(Elements)<=10
0281             for i = 1:length(Elements)
0282                 legendstr{i} = sprintf('BPM(%d)',BPMData.HBPMGoodDataIndex(Elements(i)));
0283             end
0284             legend(legendstr,0);
0285         end
0286         axis tight
0287     end
0288 end
0289 
0290 
0291 if strcmp(PlaneString,'VBPM')
0292     BPMData.BPMIndex = BPMData.BPMIndex(:);
0293     if ~exist('ElementsInput','var')
0294         ElementsInput = locoeditlist([BPMData.VBPMGoodDataIndex(:) BPMData.BPMIndex(BPMData.VBPMIndex(BPMData.VBPMGoodDataIndex))], PlaneString, zeros(length(BPMData.VBPMGoodDataIndex),1));
0295         if isempty(ElementsInput)
0296             return
0297         end
0298         ElementsInput = ElementsInput(:,1)';
0299     end
0300     if isempty(ElementsInput)
0301         ElementsInput = locoeditlist([BPMData.VBPMGoodDataIndex(:) BPMData.BPMIndex(BPMData.VBPMIndex(BPMData.VBPMGoodDataIndex))], PlaneString, zeros(length(BPMData.VBPMGoodDataIndex),1));
0302         if isempty(ElementsInput)
0303             return
0304         end
0305         ElementsInput = ElementsInput(:,1)';
0306     end
0307     
0308     % Convert to elements in the HBPMGoodDataIndex vector
0309     [tmp1, tmp2, Elements] = intersect(ElementsInput, BPMData.VBPMGoodDataIndex);
0310     
0311     if ~isempty(Elements)
0312         plot(data(NHBPM+Elements,:)');
0313         
0314         % Change label to HCM and VCM numbers
0315         N = NHCM + NVCM;
0316         Ticks = 1:ceil(N/10):N;
0317         set(gca, 'XTick', Ticks);      
0318         TickNumber = [CMData.HCMGoodDataIndex(:)' CMData.VCMGoodDataIndex(:)'];
0319         TickNumber = TickNumber(Ticks);
0320         set(gca, 'XTickLabel', num2cell(TickNumber));         
0321         xlabel('Horizontal and Vertical Corrector Magnets');
0322         
0323         if strcmp(lower(PlotString),'model')
0324             title('Model Response Matrix');
0325             if length(Elements) == 1
0326                 ylabel(sprintf('Vertical BPM(%d) [mm]', BPMData.VBPMGoodDataIndex(Elements)));
0327             else
0328                 ylabel('Vertical BPM [mm]');
0329             end
0330         elseif strcmp(lower(PlotString),'measured')
0331             title('Measured Response Matrix');
0332             if length(Elements) == 1
0333                 ylabel(sprintf('Vertical BPM(%d) [mm]', BPMData.VBPMGoodDataIndex(Elements)));
0334             else
0335                 ylabel('Vertical BPM [mm]');
0336             end
0337         elseif strcmp(lower(PlotString),'model-measured')
0338             title('Model - Measured Response Matrix');
0339             if length(Elements) == 1
0340                 ylabel(sprintf('Vertical Error BPM(%d) [mm]', BPMData.VBPMGoodDataIndex(Elements)));
0341             else
0342                 ylabel('Vertical BPM Error [mm]');
0343             end
0344         elseif strcmp(lower(PlotString),'model-measured+energyshifts')
0345             title('Model-Measured+EnergyShifts Response Matrix');
0346             if length(Elements) == 1
0347                 ylabel(sprintf('Vertical Error BPM(%d) [mm]', BPMData.VBPMGoodDataIndex(Elements)));
0348             else
0349                 ylabel('Vertical BPM Error [mm]');
0350             end
0351         end
0352         
0353         % Only put a legend up to size 10
0354         if length(Elements)>1 & length(Elements)<=10
0355             for i = 1:length(Elements)
0356                 legendstr{i} = sprintf('BPM(%d)',BPMData.VBPMGoodDataIndex(Elements(i)));
0357             end
0358             legend(legendstr,0);
0359         end
0360         axis tight
0361     end
0362 end
0363 
0364 
0365 if strcmp(PlaneString,'HCM')   
0366     CMData.HCMGoodDataIndex = CMData.HCMGoodDataIndex(:)';
0367     CMData.HCMIndex = CMData.HCMIndex(:);
0368     if ~exist('ElementsInput','var')
0369         ElementsInput = locoeditlist([CMData.HCMGoodDataIndex(:) CMData.HCMIndex(CMData.HCMGoodDataIndex)], PlaneString, zeros(length(CMData.HCMGoodDataIndex),1));
0370         if isempty(ElementsInput)
0371             return
0372         end
0373         ElementsInput = ElementsInput(:,1)';
0374     end
0375     if isempty(ElementsInput)
0376         ElementsInput = locoeditlist([CMData.HCMGoodDataIndex(:) CMData.HCMIndex(CMData.HCMGoodDataIndex)], PlaneString, zeros(length(CMData.HCMGoodDataIndex),1));
0377         if isempty(ElementsInput)
0378             return
0379         end
0380         ElementsInput = ElementsInput(:,1)';
0381     end
0382 
0383     % Convert to elements in the HCMGoodDataIndex vector
0384     [tmp1, tmp2, Elements] = intersect(ElementsInput, CMData.HCMGoodDataIndex);
0385     
0386     if ~isempty(Elements)
0387         plot(data(:,Elements));
0388 
0389         % Change label to BPM numbers
0390         N = NBPM;
0391         Ticks = 1:ceil(N/10):N;
0392         set(gca, 'XTick', Ticks);      
0393         TickNumber = [BPMData.HBPMGoodDataIndex(:)' BPMData.VBPMGoodDataIndex(:)'];
0394         TickNumber = TickNumber(Ticks);
0395         set(gca, 'XTickLabel', num2cell(TickNumber));         
0396         xlabel('Horizontal and Vertical BPM Numbers');
0397                 
0398         if strcmp(lower(PlotString),'model')
0399             title('Model Response Matrix');
0400             if length(ElementsInput) == 1
0401                 ylabel(sprintf('HCM(%d) [mm]', ElementsInput));
0402             else
0403                 ylabel('HCM [mm]');
0404             end
0405         elseif strcmp(lower(PlotString),'measured')
0406             title('Measured Response Matrix');
0407             if length(ElementsInput) == 1
0408                 ylabel(sprintf('HCM(%d) [mm]', ElementsInput));
0409             else
0410                 ylabel('HCM [mm]');
0411             end
0412         elseif strcmp(lower(PlotString),'model-measured')
0413             title('Model - Measured Response Matrix');
0414             if length(ElementsInput) == 1
0415                 ylabel(sprintf('HCM(%d) Error [mm]', ElementsInput));
0416             else
0417                 ylabel('HCM Error [mm]');
0418             end
0419         elseif strcmp(lower(PlotString),'model-measured+energyshifts')
0420             title('Model-Measured+EnergyShifts Response Matrix');
0421             if length(ElementsInput) == 1
0422                 ylabel(sprintf('HCM(%d) Error [mm]', ElementsInput));
0423             else
0424                 ylabel('HCM Error [mm]');
0425             end
0426         end
0427         
0428         % Only put a legend up to size 10
0429         if length(ElementsInput)>1 & length(ElementsInput)<=10
0430             for i = 1:length(ElementsInput)
0431                 legendstr{i} = sprintf('HCM(%d)',ElementsInput(i));
0432             end
0433             legend(legendstr,0);
0434         end
0435         axis tight
0436     end
0437 end
0438 
0439 
0440 
0441 if strcmp(PlaneString,'VCM')
0442     CMData.VCMGoodDataIndex = CMData.VCMGoodDataIndex(:)';
0443     CMData.VCMIndex = CMData.VCMIndex(:);
0444     if ~exist('ElementsInput','var')
0445         ElementsInput = locoeditlist([CMData.VCMGoodDataIndex(:) CMData.VCMIndex(CMData.VCMGoodDataIndex)], PlaneString, zeros(length(CMData.VCMGoodDataIndex),1));
0446         if isempty(ElementsInput)
0447             return
0448         end
0449         ElementsInput = ElementsInput(:,1)';
0450     end
0451     if isempty(ElementsInput)
0452         ElementsInput = locoeditlist([CMData.VCMGoodDataIndex(:) CMData.VCMIndex(CMData.VCMGoodDataIndex)], PlaneString, zeros(length(CMData.VCMGoodDataIndex),1));
0453         if isempty(ElementsInput)
0454             return
0455         end
0456         ElementsInput = ElementsInput(:,1)';
0457     end
0458             
0459     % Convert to elements in the VCMGoodDataIndex vector
0460     [tmp1, tmp2, Elements] = intersect(ElementsInput, CMData.VCMGoodDataIndex);
0461     
0462     if ~isempty(Elements)
0463         plot(data(:,NHCM+Elements));
0464         
0465         % Change label to BPM numbers
0466         N = NBPM;
0467         Ticks = 1:ceil(N/10):N;
0468         set(gca, 'XTick', Ticks);      
0469         TickNumber = [BPMData.HBPMGoodDataIndex(:)' BPMData.VBPMGoodDataIndex(:)'];
0470         TickNumber = TickNumber(Ticks);
0471         set(gca, 'XTickLabel', num2cell(TickNumber));         
0472         xlabel('Horizontal and Vertical BPM Numbers');
0473                 
0474         if strcmp(lower(PlotString),'model')
0475             title('Model Response Matrix');
0476             if length(Elements) == 1
0477                 ylabel(sprintf('VCM(%d) [mm]', CMData.VCMGoodDataIndex(Elements)));
0478             else
0479                 ylabel('VCM [mm]');
0480             end
0481         elseif strcmp(lower(PlotString),'measured')
0482             title('Measured Response Matrix');
0483             if length(Elements) == 1
0484                 ylabel(sprintf('VCM(%d) [mm]', CMData.VCMGoodDataIndex(Elements)));
0485             else
0486                 ylabel('VCM [mm]');
0487             end
0488         elseif strcmp(lower(PlotString),'model-measured')
0489             title('Model - Measured Response Matrix');
0490             if length(Elements) == 1
0491                 ylabel(sprintf('VCM(%d) Error [mm]', CMData.VCMGoodDataIndex(Elements)));
0492             else
0493                 ylabel('VCM Error [mm]');
0494             end
0495         elseif strcmp(lower(PlotString),'model-measured+energyshifts')
0496             title('Model-Measured+EnergyShifts Response Matrix');
0497             if length(Elements) == 1
0498                 ylabel(sprintf('VCM(%d) Error [mm]', CMData.VCMGoodDataIndex(Elements)));
0499             else
0500                 ylabel('VCM Error [mm]');
0501             end
0502         end
0503         
0504         % Only put a legend up to size 10
0505         if length(Elements)>1 & length(Elements)<=10
0506             for i = 1:length(Elements)
0507                 legendstr{i} = sprintf('VCM(%d)',CMData.VCMGoodDataIndex(Elements(i)));
0508             end
0509             legend(legendstr,0);
0510         end
0511         axis tight
0512     end
0513 end
0514 
0515 if ~exist('ElementsInput','var') & nargout > 0
0516     ElementsInput = [];
0517 end

Generated on Fri 01-Aug-2008 10:57:33 by m2html © 2003