Smoothing the Data with For Loop (Sliding Window)

2 views (last 30 days)
Hello,
I am taking the datas from my sensor and the datas are the multiples of 5.8594 so my whole data looks like a mix of square wave and ramp function. What I want is, smooth the corners of this data with for loop. I want to see exponential-like or sinusoidal-like signal while iterating. I can do it with whole data but can not do it with for loop.
Thank you for your suggestions.
  2 Comments
Jan
Jan on 5 Feb 2023
"I can do it with whole data but can not do it with for loop." - Why not? what exactly is the problem and what is the purpose to use a loop at all? What do you want to loop over?

Sign in to comment.

Answers (1)

Mathieu NOE
Mathieu NOE on 10 Feb 2023
hello
seems to me smoothdata can do what you need
plot(temperature)
hold on
ts = smoothdata(temperature,'gaussian',30);
plot(ts)

Community Treasure Hunt

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

Start Hunting!

Translated by