View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

Be the first to rate this file! 2 Downloads (last 30 days) File Size: 1.24 KB File ID: #40444 Version: 1.0



Ben Barrowes (view profile)


Converts all numeric variables in the workspace, or optionally all doubles only, to single precision

| Watch this File

File Information

% TOSINGLE - toSingle(doublesOnly)
% Converts all numerical variables in the calling
% workspace to single precision
% If doublesOnly is nonzero, then it converts only
% the doubles in the calling workspace to singles

Required Products MATLAB
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
21 Feb 2013 Jan Simon

Jan Simon (view profile)

The dynamic change of the types will reduce the memory footprint of a function, but it is very likely that the processing time will grow: Matlab's JIT acceleration is impeded by such dynamic changes. Some functions need 100 times longer afterwards compared to a explicit and direct creation of the variables in the wanted class.

Comment only

Contact us