Info
この質問は閉じられています。 編集または回答するには再度開いてください。
to build a histogram
1 回表示 (過去 30 日間)
古いコメントを表示
Hi everybody. I need a help. I'm trying to make a histogram which the average value must be zero. So, I'm not getting a histogram which has in axis-x both values positives and negatives.
This is the function which I'm using:
function freqDT = htgDT(da,det)
% Chamamos a função dife para realizar a diferença de tempo. Ela retorna uma matriz com as diferenaças
DF=dife(da,det);
b=size(DF);
MDT=zeros(2001,b(1,2)); %A quantidade de diferenças corresponderá a quantidade de colunas de DF
for y =1:b(1,2) %y varia conforme a quantidade de diferenças
for x = 1:b(1,1)
c = DF(x,y);
if c == 0
MDT(1,y)=MDT(1,y) + 1;
end
if c>0 && c<1000
MDT(c+1,y)=MDT(c+1,y) + 1;
end
%%%%%%%%%%%%%%the probleme is here%%%%%%%%%%%%
if c<0 && abs(c)<1000
%x
%M=abs(c)+1000
MDT(abs(c)+1000,y)= MDT(abs(c)+1000,y) + 1;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end
end
freqDT = MDT;
end
0 件のコメント
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!