How to split a matrix of absolute value in min and max?
Show older comments
Dear all,
Unfortunately, I have not found an answer to my question in the forum, which is why I would like to address the following question to you:
I have a matrix A=(10,1,10000) where 10 is the number of periods t. I would like to make 3 plots. In the first plot I want to show in which periods the 10,000 draws reach their peak, regardless of the sign, but in absolute value. To do this, I proceeded as follows:
X=abs(A(10,1,10000));
[ii,jj]=max(X);
N=accumarray(jj(:),1).';
This gives me a plot where I have t=1:10 on the x axis and the summed number of peaks for each t is shown on the y axis. But now I want two more plots in which I do the same again but take the sign into account. That is, in one plot I want to show the number of peaks in each period when the peak in ii is a maximum and in the other plot I want to show the number of peaks in each period when the peak in ii is a minimum.
Unfortunately, I always get a Min Matrix B = (1,1,10000) and a Max Matrix C=(1,1,10000). But the 10,000 entries should be split into min and max, e.g. B = (1,1,3500) and C=(1,1,6500);
Can someone tell me how to do this?
Many thanks for your help!
Accepted Answer
More Answers (0)
Categories
Find more on Axis Labels in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
