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!