7 lines
256 B
Matlab
7 lines
256 B
Matlab
function Int32Out = Int8ToInt32(Int8In)
|
|
%% 8bit转32bit
|
|
Int8In(Int8In<0) = Int8In(Int8In<0)+256;
|
|
tmp = reshape(Int8In,4,[]);
|
|
Int32Out = bitshift(tmp(1,:),0)+bitshift(tmp(2,:),8)+...
|
|
bitshift(tmp(3,:),16)+bitshift(tmp(4,:),24);
|
|
end |