A = sscanf(s,'format')
A = sscanf(s,'format',size)
[A,count] = sscanf(...)
A = sscanf(s,'format')
reads data from the MATLAB string variable s
, converts it according to the specified format
string, and returns it in matrix A
.
A = sscanf(s,'format',size)
specifies the number of elements to generate.
[A,count] = sscanf(...)
also returns the number of elements successfully read.
sscanf
is the same as fscanf
except that it reads the data from a MATLAB string variable rather than reading it from a file. See fscanf
for full information on how to use sscanf
.
create a two-element vector containing poor approximations to e ands = '2.7183 3.1416';
A = sscanf(s,'%f')
pi
.
eval
,fscanf
,sprintf
(c) Copyright 1994 by The MathWorks, Inc.