Change length of double data
Show older comments
I have 803385 x 1 data double and i want to change to 7547 x 1, how to change it because the graphs are have same shape and i need to change the lenght
3 Comments
Steven Lord
on 26 Aug 2020
Do you want to take just the first 7547 elements? The last? The middle? Do you want to interpolate? Do you want to take (roughly) every 106th element?
Iqbal Taufik Irfanda
on 26 Aug 2020
Steven Lord
on 26 Aug 2020
Let's say you had a 12 element vector that you wanted to shrink down to a 6 element vector.
x = 1:12
There are may different ways to extract six elements out of x. Some of the possibilities:
x1 = x(1:6)
x2 = x(7:12)
x3 = x(4:9)
x4 = x(1:2:11)
x5 = x(randperm(numel(x), 6))
You can also interpolate.
x6 = interp1(1:numel(x), x, linspace(1, numel(x), 6))
How do you want to make a six element vector out of x?
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!