%% Convert Text and Resize Output Array
% Create a string that represents several numbers and convert it using sscanf. Specify the size of the output array.
% Starting in R2017a, you can create strings using double quotes.

str = "2.7183  3.1416  0.0073"

%

A = sscanf(str,'%f',[1 3])

%
% Convert str to a 2-by-2 matrix. Because str represents only three numbers, sscanf pads A with enough zeroes to fill in the matrix.

A = sscanf(str,'%f',[2 2])

% Copyright 2012 The MathWorks, Inc.