|
232 | 232 | end |
233 | 233 | end |
234 | 234 |
|
| 235 | +function [int_values,file] = get_int_list(file,nValues) |
| 236 | +int_values = zeros(1,nValues); |
| 237 | +i = 0; |
| 238 | +if nValues == 0 |
| 239 | + readFromCurrentLineOnly = true; |
| 240 | +else |
| 241 | + readFromCurrentLineOnly = false; |
| 242 | +end |
| 243 | +while i < nValues || readFromCurrentLineOnly |
| 244 | + i = i+1; |
| 245 | + try |
| 246 | + [int_values(i),file] = get_int(file, readFromCurrentLineOnly); |
| 247 | + catch err |
| 248 | + if readFromCurrentLineOnly |
| 249 | + break |
| 250 | + end |
| 251 | + end |
| 252 | +end |
| 253 | + |
235 | 254 | function FI=open_ascii(FI,file) |
236 | 255 | zone_found = false; |
237 | 256 | in_record = 'HEADER'; |
|
511 | 530 | nVar = length(FI.Variables); |
512 | 531 | % |
513 | 532 | if strcmpi(Zone.Type,'ORDERED') |
514 | | - if isfield(Zone,'kMax') % 3D |
| 533 | + if isfield(Zone,'KMax') % 3D |
515 | 534 | blockSize = [Zone.IMax Zone.JMax Zone.KMax]; |
516 | | - elseif isfield(Zone,'jMax') % 2D |
| 535 | + elseif isfield(Zone,'JMax') % 2D |
517 | 536 | blockSize = [Zone.IMax Zone.JMax]; |
518 | 537 | else % 1D |
519 | 538 | blockSize = Zone.IMax; |
|
543 | 562 | FI.Zone(z).Data = data; |
544 | 563 | % |
545 | 564 | if ~strcmpi(Zone.Type,'ORDERED') |
546 | | - if isfield(Zone,'elementSize') && ~isempty(Zone.ElementSize) |
| 565 | + if isfield(Zone,'ElementSize') && ~isempty(Zone.ElementSize) |
547 | 566 | blockSize = [Zone.ElementSize FI.Zone(z).NElements]; |
548 | 567 | [topo,nRead] = fscanf(file.fid,'%i',prod(blockSize)); |
549 | 568 | if nRead < prod(blockSize) |
|
609 | 628 | value = value * 10^exponent; |
610 | 629 | end |
611 | 630 | newData = cat(1,newData(1:end-1),repmat(value,newData(end),1)); |
| 631 | + nRead = length(newData); |
612 | 632 |
|
613 | 633 | otherwise |
614 | 634 | if nTotalRead+nRead < numValues |
|
0 commit comments