필터 지우기
필터 지우기

Updating parameter, plus plot, with slider input "in real time"

조회 수: 148 (최근 30일)
Corey
Corey 2022년 8월 31일
댓글: Corey 2022년 9월 5일
I am fairly new to MATLAB and am working with code that generates eight different subplots from a set of input parameters (the program already exists, and I am just its most recent user)
I want to be able to change these parameters "in real time" by manipulating the sliding bars (creating the sliding bars with the correct properties is as far as I've been able to get so far) and have these plots then update with the new parameters that the slider is set to (also "in real time"), all without having to re-run the function from the command window
Is there a convenient way to do this in MATLAB (ideally without having to rewrite the code for every single one of the subplots)? And if I am able to do this for one parameter, can I simply extrapolate from it to the rest of the parameters?
Thanks!

채택된 답변

Seth Furman
Seth Furman 2022년 9월 3일
There are two main ways to interactively update a plot with a slider.
1. Create a Live Script with an interactive numeric slider (this is probably what you want).
2. Create an App that incorporates a uislider (this is more customizable but will require more coding).

추가 답변 (1개)

Chunru
Chunru 2022년 9월 1일
  댓글 수: 3
Chunru
Chunru 2022년 9월 1일
So you have to post your code for further help. Otherwise it's difficult, if not possible to guess what you want.
Corey
Corey 2022년 9월 1일
I will need to request permission to post the code here. But, just to reiterate, I'm looking to update parameters in real time using GUI sliders, and to refresh the subplots relying on those parameters without reissuing the function command in the command window.
It's not, as the linked document suggests, merely a restatement of one coordinate axis of one plot -- each of these subplots relies on a different combination of the same parameters, and, ideally, the parameter itself should be what's changing

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Graphics Objects에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by