||
function [i,j] = ind2ij(ind, nb_line)
i= mod(ind, nb_line); % line number
ind_ind = 1:length(ind);
end_line = find(i == 0);
if ~isempty(end_line)
i(end_line) = nb_line;
j(end_line) = ind(end_line)/nb_line;
ind_ind(end_line) = [];
end
j(ind_ind) = floor(ind(ind_ind) /nb_line)+1;
function ind = ij2ind(i, j, nb_line)
ind = (j-1)*nb_line+i;
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-22 06:54
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社