| 
102 | 102 | % Check if the reference structure contains width, start, and data fields,  | 
103 | 103 | % and if the size of the width and start vectors are equal  | 
104 | 104 | if ~isfield(varargin{1}, 'width') || ~isfield(varargin{1}, 'start') || ...  | 
105 |  | -        ~isfield(varargin{1}, 'data') || ~isequal(size(varargin{1}.width), ...  | 
106 |  | -        size(varargin{1}.start))  | 
 | 105 | +        ~isfield(varargin{1}, 'data') || ~isequal(length(varargin{1}.width), ...  | 
 | 106 | +        length(varargin{1}.start))  | 
107 | 107 | 
 
  | 
108 | 108 |     % If not, throw an error and stop execution  | 
109 | 109 |     if exist('Event', 'file') == 2  | 
 | 
117 | 117 | % Check if the target structure contains width, start, and data fields,  | 
118 | 118 | % and if the size of the width and start vectors are equal  | 
119 | 119 | elseif ~isfield(varargin{2}, 'width') || ~isfield(varargin{2}, 'start') || ...  | 
120 |  | -        ~isfield(varargin{2}, 'data') || ~isequal(size(varargin{2}.width), ...  | 
121 |  | -        size(varargin{2}.start))  | 
 | 120 | +        ~isfield(varargin{2}, 'data') || ~isequal(length(varargin{2}.width), ...  | 
 | 121 | +        length(varargin{2}.start))  | 
122 | 122 | 
 
  | 
123 | 123 |     % If not, throw an error and stop execution  | 
124 | 124 |     if exist('Event', 'file') == 2  | 
 | 
254 | 254 | 
 
  | 
255 | 255 | %% Compute mesh grids  | 
256 | 256 | % If the reference dataset is 1-D  | 
257 |  | -if size(varargin{1}.width,2) == 1  | 
 | 257 | +if length(varargin{1}.width) == 1  | 
258 | 258 | 
 
  | 
259 | 259 |     % Log event  | 
260 | 260 |     if exist('Event', 'file') == 2  | 
 | 
273 | 273 |         + varargin{1}.width(1) * (size(varargin{1}.data,2) - 1));  | 
274 | 274 | 
 
  | 
275 | 275 | % Otherwise, if the reference dataset is 2-D  | 
276 |  | -elseif size(varargin{1}.width,2) == 2  | 
 | 276 | +elseif length(varargin{1}.width) == 2  | 
277 | 277 | 
 
  | 
278 | 278 |     % Log event  | 
279 | 279 |     if exist('Event', 'file') == 2  | 
 | 
289 | 289 |         * (size(varargin{1}.data,1) - 1)));  | 
290 | 290 | 
 
  | 
291 | 291 | % Otherwise, if the reference dataset is 3-D  | 
292 |  | -elseif size(varargin{1}.width,2) == 3  | 
 | 292 | +elseif length(varargin{1}.width) == 3  | 
293 | 293 | 
 
  | 
294 | 294 |     % Log event  | 
295 | 295 |     if exist('Event', 'file') == 2  | 
 | 
319 | 319 | end  | 
320 | 320 | 
 
  | 
321 | 321 | % If the target dataset is 1-D  | 
322 |  | -if size(varargin{2}.width,2) == 1  | 
 | 322 | +if length(varargin{2}.width) == 1  | 
323 | 323 | 
 
  | 
324 | 324 |     % Log event  | 
325 | 325 |     if exist('Event', 'file') == 2  | 
 | 
338 | 338 |         + varargin{2}.width(1) * (size(varargin{2}.data,2) - 1));  | 
339 | 339 | 
 
  | 
340 | 340 | % Otherwise, if the target dataset is 2-D  | 
341 |  | -elseif size(varargin{2}.width,2) == 2  | 
 | 341 | +elseif length(varargin{2}.width) == 2  | 
342 | 342 | 
 
  | 
343 | 343 |     % Log event  | 
344 | 344 |     if exist('Event', 'file') == 2  | 
 | 
354 | 354 |         * (size(varargin{2}.data,1) - 1)));  | 
355 | 355 | 
 
  | 
356 | 356 | % Otherwise, if the target dataset is 3-D  | 
357 |  | -elseif size(varargin{2}.width,2) == 3  | 
 | 357 | +elseif length(varargin{2}.width) == 3  | 
358 | 358 | 
 
  | 
359 | 359 |     % Log event  | 
360 | 360 |     if exist('Event', 'file') == 2  | 
 | 
428 | 428 |         k = 0;  | 
429 | 429 | 
 
  | 
430 | 430 |         % If the data contains a second dimension  | 
431 |  | -        if size(varargin{1}.width,2) > 1  | 
 | 431 | +        if length(varargin{1}.width) > 1  | 
432 | 432 | 
 
  | 
433 | 433 |             % Start a for loop to interpolate the dose array along the  | 
434 | 434 |             % y-direction.  Note to support parfor loops indices must be  | 
 | 
445 | 445 |                 k = 0;  | 
446 | 446 | 
 
  | 
447 | 447 |                 % If the data contains a third dimension  | 
448 |  | -                if size(varargin{1}.width, 2) > 2  | 
 | 448 | +                if length(varargin{1}.width) > 2  | 
449 | 449 | 
 
  | 
450 | 450 |                     % Start a for loop to interpolate the dose array along   | 
451 | 451 |                     % the z-direction.  Note to support parfor loops   | 
 | 
542 | 542 |         k = 0;  | 
543 | 543 | 
 
  | 
544 | 544 |         % If the data contains a second dimension  | 
545 |  | -        if size(varargin{1}.width, 2) > 1  | 
 | 545 | +        if length(varargin{1}.width) > 1  | 
546 | 546 | 
 
  | 
547 | 547 |             % Start a for loop to interpolate the dose array along the  | 
548 | 548 |             % y-direction.  Note to support parfor loops indices must be  | 
 | 
559 | 559 |                 k = 0;  | 
560 | 560 | 
 
  | 
561 | 561 |                 % If the data contains a third dimension  | 
562 |  | -                if size(varargin{1}.width, 2) > 2  | 
 | 562 | +                if length(varargin{1}.width) > 2  | 
563 | 563 | 
 
  | 
564 | 564 |                     % Start a for loop to interpolate the dose array along   | 
565 | 565 |                     % the z-direction.  Note to support parfor loops   | 
 | 
0 commit comments