How to smooth Data on App Designer for only plot on display
조회 수: 8 (최근 30일)
이전 댓글 표시
Hello Everyone,
I'm trying to smooth some dataset on an app I'm creating on App Designer. The app imports several different datasets and I have made buttons to call up data and plot each separately in an axes I created although not simultaneosly. Now I want to add a slider underneath to smoothen any given dataset on display. Any advice on how to make a custom slider for this?
Thanks in advance.
댓글 수: 0
답변 (1개)
TADA
2021년 7월 27일
You can save the original data in a different property, then plot it as response to the slider callback
See simple example I made that uses a button, slider and axes
the button randomizes some noisy data, and both button and slider callbacks call the doplot function which smoothes the original data according to the spinner value.
here moving average smoothing is applied and the smoothing span is controlled by the spinner value.
댓글 수: 2
TADA
2021년 7월 27일
I'm pretty sure smooth is part of the curve fitting toolbox, if you don't have access to that toolbox, you can look in the file exchange, someone surely implemented something...
Or you can pretty easily implement some simple smoothing filter yourself
As for multiple datasets, you can pretty easily implement the same thing, either by calling several methods from the callback hardcoded, or by calling a list of function handles in a loop, or save the datasets in a cellarray for instance and plotting using a loop or any number of other solutions. It's up to you
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!