Difference Between ValueChangedFcn & ValueChangingFcn

229 ビュー (過去 30 日間)
John hope
John hope 2019 年 4 月 24 日
コメント済み: Christina 2023 年 4 月 25 日
Hi all
I have a GUI which includes:-
Edit Field Text
Edit Field Text
Text Area
For Edit Field Text & Edit Field Text i have the option to create two callbacks which are:-
1) Add ValueChangedFcn
2) Add ValueChangingFcn
Can anyone explain what the difference is between these two?
Also on the Text Area i can only create one call back which is:-
1) Add ValueChangedFcn
Why isnt there an option for Add ValueChangingFcn for Text Area?
I know i'm being a little thick but Matlab isnt a strong area for me.
Thank you
  1 件のコメント
Rik
Rik 2019 年 4 月 24 日
Have you tried searching the documentation (or Google)? This sounds like a difference due to a property being renamed in some release, but I would have to search the doc to confirm.

サインインしてコメントする。

採用された回答

Rik
Rik 2019 年 4 月 24 日
If you read the documentation carefully, you will notice a subtle difference. This difference is more easily explained with a uislider object as an example.
The ValueChangedFcn executes when the user finishes interacting with the object, which means it only triggers when the user releases the nob in the slider, not on every movement. This makes it similar to a Callback property outside of App Designer.
The ValueChangingFcn executes during the user interaction, so it responds to a single key stroke or slider drag. This means you can separate small live changes from full processing when a slider is released or a text has been completed.
Because the second function is triggered often, you will have to make sure that it is very fast.
  2 件のコメント
John hope
John hope 2019 年 4 月 24 日
移動済み: Rik 2023 年 3 月 21 日
Rik
Thanks for that.
:)
Christina
Christina 2023 年 4 月 25 日
Had the same question, thank you as well!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT-Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by