📄 write_uint32_hex.m
字号:
function write_uint32_hex(name,A)
%
% write_uint32_hex(name,A)
%
% Write elements of matrix A in .dat format, suitable for loading
% into Code Composer Studio.
%
% Elements are rounded to 32-bit unsigned integer format
% and the values are stored in hex-format (little endian)
N=prod(size(A));
% convert to double, and/or round to nearest integer
A=round(double(A));
if any(A>2^32-1 | A<0)
error('One or more values are out of range')
end
fid = fopen(name,'wt');
fprintf(fid,'1651 1 0 0 %X\n',N);
fprintf(fid,'0x%08X\n',A);
fclose(fid);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -