So I am creating an app to work out a value based on a series of variables. The variables are:
- Gender
- Age
- Weight
- Creatinine
Here's what the app looks like:
In order to simplify the process somewhat I decided to make the gender selection a dropdown menu, this has caused me some issues since I have it setup like so:
And the maths associated with the button looks like so:
function CalculateButtonPushed(app, event)
gender = app.PatientGenderDropDown.Value ;
age = app.PatientAgeEditField.Value ;
weight = app.LeanBodyWeightEditField.Value ;
serum = app.SerumCreatinineEditField.Value ;
final = (gender*(age)*weight) / (serum) ;
app.ResultEditField.Value = final ;
end
end
Running this gives the following error:
Error using matlab.ui.control.internal.model.AbstractNumericComponent/set.Value (line 104) 'Value' must be numeric, such as 10.
As far as I am aware, the values I input into ItemsData
are numeric values. Have I missed something or is there a better way to do this?