plot_cumu_matrix.m

来自「best routing protocol」· M 代码 · 共 30 行

M
30
字号
function plot_cumu_matrix(m,str, precision, ignore_inf)%Plot data in a CDF format%m: data points%str: plot string, default empty%precision: how precise do we want, default 1000%ignore_inf: ignore the entries where inf is usedif nargin<3 precision=500; endif nargin<2 str=''; endif nargin<4 ignore_inf=0; endsorted = sort(m(:));if ignore_inf  sorted = sorted(find(sorted<inf));endN = length(sorted);m = N;if N>precision m=precision; endm_array = 1/m:1/m:1;pos_array = round(m_array.*N);plot(sorted(pos_array), m_array, str);return%plot a cumulative graph of matrix m with M*N    [M,N] = size(m);    a = M*N;    m_array = 1/a:1/a:1;    f_array = reshape(m,1,a);    plot(sort(f_array),m_array,str)

⌨️ 快捷键说明

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