Info

この質問は閉じられています。 編集または回答するには再度開いてください。

GUI takes input and push button calls m file then will display the result in GUI

1 回表示 (過去 30 日間)
Hafizuddin Bin Mohd Lowhim
Hafizuddin Bin Mohd Lowhim 2020 年 8 月 4 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello Matlab community,
I have this GUI and CRC8.m. Now I can call the crc8 inside the push button. But, the input shall be from the Numeric field edit and the result from the crc8 shall be displayed in Text field edit. How I suppose to do that in Appdesigner?
  5 件のコメント
Hafizuddin Bin Mohd Lowhim
Hafizuddin Bin Mohd Lowhim 2020 年 8 月 4 日
Yes 2 questions since the tutorial doesn't cover the m file. Most people discuss how to do it in guide but not in appdesigner.
  1. How to pass the value from Numeric Field edit to m file as input?
  2. How my m file knows it should receive input from Numeric Field edit?
Adam Danz
Adam Danz 2020 年 8 月 4 日
The function should be written within AppDesgiern unless the function in your m-file is being used by other functions and scripts outside of AppDesiger.
Re #1) Assuming the function must be external to the app, within an m-file, you can pass any variable you want from app designer in the same way you would pass a variable to any function. To access the value of an app component, follow the example under "Using Callback Function Input Arguments" in the 3rd tutorial I listed.
Re #2) Not sure what you mean here. The value you pass will be an input to the function in your m-file.
Tutorial on creating functions:

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by