How can I determine or formulate certain intervals from a given set of data.
1 次查看(过去 30 天)
显示 更早的评论
Assuming that I have the following data.
0.110064
0.120277
8.957109
-------
-------
8.957806
-------
-------
50.69346
50.6958
50.69846
-------
-------
up to n
I want to have about 20 groups of intervals such as,
interval(1)= 0.110064 to 0.310064
interval(2)= 0.310064 to 0.510064
-------------------------
-------------------------
interval(n)= a to b
interval(n+1)= c to d
where a, b, c, d are any values within the data. Please note a<b<c<d
At the end, I want to have something like this (where the first number is extracted from the lower range of the first interval , followed by its upper range (as the second number); and the third number being the upper range of the second interval etc), as shown below.
IntervalRange(1)= 0.110064
IntervalRange(2)= 0.310064
IntervalRange(3)= 0.510064
-------------------------
-------------------------
IntervalRange(k)= n
IntervalRange(k+1)= n+1
In fact the output should only be like the one below;
*0.110064
0.310064
0.510064
n
n+1
Thank you*
0 个评论
采纳的回答
Matz Johansson Bergström
2014-7-26
编辑:Matz Johansson Bergström
2014-7-26
If I understand it correctly, you want something like this?
%mock data, increasing numbers
data = 50*rand(50,1);
data = sort(data);
%The intervals
iv = linspace(data(1), data(end), 20)
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!