how to resize my large vector to a smaller one for plotting?

hey guys, I have a large vector with length of 185437, i want to make a new one, reshaped vector with mean values of this one but I need new length to be 180*delay because on x axis i must have like this, for example:
delay=0.1
x_axis=0:delay:180
i need y axis (this new vector) to be same size as this x_axis so I can plot it. I tried something like:
values_delay_sum_plot=mean(reshape(values_delay_sum,1/delay,length(values_delay_sum)*delay));
but it is not working. First errors was for integer values, later that I can't change size of vector. Note that, values_delay_sum is my large vector, a from it I wanna make a new one for my plot. thanks in advance.

Answers (1)

doc resample

6 Comments

resample(values_delay_sum,100,round(length(values_delay_sum)/100))
When I try it i got this errors.....
Error using *
BLAS loading error:
dlopen: cannot load any more object with static TLS
Error in rat (line 103)
C = [C*[d;1] C(:,1)];
Error in resample (line 70)
[p,q] = rat( p/q, 1e-12 ); %--- reduce to lowest terms
values_delay_sum = rand(185437,1);
resample(values_delay_sum,100,round(length(values_delay_sum)/100));
It works for me. What do you have in values_delay_sum?
values_delay_sum is vector that is random generated and aproxx has between 180500 and 200100 values in it.
What does
class(values_delay_sum)
size(values_delay_sum)
return?
It returns
>> class(values_delay_sum)
ans =
double
>> size(values_delay_sum)
ans =
1 16019
What's the time stamp of that vector?

Sign in to comment.

Asked:

on 9 Jun 2014

Commented:

on 9 Jun 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!