www.gusucode.com > images 案例代码 matlab源码程序 > images/ConvertArrayToClassSingleExample.m

    %% Convert Array to Class Single
% This example shows how to convert an array of class |uint8| into class
% |single| .
%%
% Create a numeric array of class |uint8| . 

% Copyright 2015 The MathWorks, Inc.

I = reshape(uint8(linspace(1,255,25)),[5 5])
%%
% Convert the array to class |single| .
I2 = im2single(I)