📄 icbread.m
字号:
function A = icbread(filename)% A = ICBREAD(FILENAME)% % Reads the QccPack ICB-format file specified by FILENAME into A.%% A is returned as a double array of size% num_frames x num_rows x num_cols%fid = fopen(filename, 'r', 'ieee-be');header_value = fgetl(fid);magic_num = sscanf(header_value, '%[A-Z]');if (magic_num ~= 'ICB') error([filename ' is not an ICB file'])endnum_cols = fscanf(fid, '%d', 1);num_rows = fscanf(fid, '%d', 1);num_frames = fscanf(fid, '%d', 1);min_val = fscanf(fid, '%f', 1);max_val = sscanf(fgets(fid), '%f', 1);data = fread(fid, num_frames * num_rows * num_cols, 'float32');frame_size = num_rows * num_cols;index = 1;A = zeros([num_frames num_rows num_cols]);for frame = 1:num_frames A(frame, 1:num_rows, 1:num_cols) = ... reshape(data(index:(index + frame_size - 1)), num_cols, num_rows)'; index = index + (num_rows * num_cols);endfclose(fid);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -