plottopdir.m

来自「脊波工具和相关实验以及有关实验数据」· M 代码 · 共 43 行

M
43
字号
function plottopdir(ra, n, sorp)% Plot the top n projections of FRATif exist('n', 'var') == 0    K = [1:5];    elseif length(n) == 1    K = [1:n];else    K = n;endn = length(K);% Energy from each projectionvar_ra = var(ra, 1);total_var = sum(var_ra);% Sort into decending order[sort_var, sort_ind] = sort(var_ra);sort_var = fliplr(sort_var);sort_ind = fliplr(sort_ind);% Plot the top n projections (which highest energy)xrange = [1, size(ra, 1)];for i = 1:n,    subplot(n, 1, i),    if exist('sorp', 'var') & sorp == 's'	stem(ra(:,sort_ind(K(i))), '.'),    else	plot(ra(:,sort_ind(K(i)))),    end        title(sprintf('Direction (k) = %d; Energy = %.2f%%', ...		  sort_ind(K(i))-1, 100 * sort_var(K(i))/ total_var)),    set(gca, 'XTickLabel', []);    set(gca, 'XLim', xrange);        % Zero line in the midle for y axis    ymax = 1.1 * max(abs(ra(:,sort_ind(K(i)))));    set(gca, 'YLim', [-ymax, ymax]);    end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?