App Designer how to set value for edit field (numeric)
Show older comments
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 Comment
Kevin Holly
on 17 Oct 2022
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?
Accepted Answer
More Answers (0)
Categories
Find more on Timetables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!