No BSD License
Highlights from
scanfc
from
scanfc
by Peter Li
scanf rewritten to give cell arrray output
|
| scanfc.m |
%SCANFC formatted scan with output to cell arrays
% [A, COUNTS] = SCANFC(S, FORMAT)
%
% Reimplements scanf for MatLab with scanned outputs returned as cell array
% objects.
%
% The native MatLab scanf assigns outputs to either numeric arrays or
% character arrays, resulting in many problems. Cell arrays are a much
% cleaner way of outputting potentially different types of scan outputs.
%
% FORMAT should use the same codes as MatLab native scanf (very similar
% to C standard). There are a few warnings thrown with message ID
% scanfc:badFormat. Use this ID to silence warnings if you wish.
%
% Output A is a Nx1 cell array with each element being one scan result.
% COUNTS is a 2x1 numeric array; the first value is how many scan results
% are expected based solely on initial parsing of the FORMAT string; the
% second value is how many scans were actually done when FORMAT was applied
% to S. A discrepancy in these numbers indicates that S did not conform to
% FORMAT as expected.
%
% Changes
% Version 1.1: Serious bug fixes
% Fixed bug in dealing with "*" for scan suppression.
% Fixed bug where scan buffer was not getting null terminated so scan
% results were spilling over from previous scans.
% Version 1.1
% Peter H. Li 17-Nov-2006
% Some rights reserved
% Licensed under Creative Commons:
% http://creativecommons.org/licenses/by-sa/2.5/
|
|
Contact us at files@mathworks.com