Gaussian filter, selecting range of values from variable to element

2 views (last 30 days)
Hi, I have two vectors of exactly 1000 elements. The first vector 'distance' ranges from 0 to 4 with equal stepsize of 0.0040. After plotting distance vs somehting different (whatever that maybe), I want to select a range of distance-values from this plot. These values, I want to use for a smoothening function. However let's say 1.1 to 1.144 are my values of interest, I want to select to according elements of these values. If I just multiple by 250, the Gaussian gives weird values. So how to I assign the right element to the function.
distance=A(:,4); %Selecting column #4 of datasheet%
FIT=(A:,10); %Selecting column #10 of datasheet%
plot(distance,FIT); %From plot, determine range of interest%
%Apply Savitsky-Goley function to data%
order=5;
framelen=11;
[y1,dy1]=sgolay_t(FIT,order,framelen); %Call S-G function to get y1%
%Apply Gaussian to range of data%
from=1.1;
to=1.114;
range_distance=distance(from:to,1);
range_FIT=y1(from:to,1);
gaus_func=gaus(range_distance,range_FIT); %Call Gaussian function%

Answers (0)

Community Treasure Hunt

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

Start Hunting!