App Designer how to set value for edit field (numeric)
이전 댓글 표시
Hello,
I'm having issues with the simplest of things. I have an app that opens a "Parameters" window. In this window I should be able to set system parameters, such as:
Carrier Frequency, Carrier Power etc.
I'm trying to edit the initial value from 0, to some default value defined in my main app. I'm not even at a stage of changing this value, just trying to grab the default instead of 0.
From the code view in the app in the "create components function", if I set an initial value manually it adds a line of app.CarrierPowerEditField.Value = 15;
I try to add this line manually at the startup function, but this affects exactly nothing for the actuall app. I still get an edit box with "0".
Only if I add a "set" button, upon press of which it will set app.CarrierPowerEditField.Value = 15 will the value change.
I can add a button for grabbing the default values, but I run into a different issue:
In the main app I create a variable as public property
DefCarPower = 15;
But if I write
app.CarrierPowerEditField.Value = app.DefCarPower;
it says "Unrecognized method, property, or field 'DefCarPower' for class 'SecondWindow'."
What am I doing wrong?
댓글 수: 1
Kevin Holly
2022년 10월 17일
Is this "Parameters" window a dialog box created with inputdlg?
Is the "Parameters" window an app? If so, which startup function are you editing, this app or the main app?
Do you have code that you can share?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Timetables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!