Building an app that does calculations based on user input

조회 수: 4 (최근 30일)
Caleb Sanders
Caleb Sanders 2019년 8월 13일
답변: TED MOSBY 2025년 8월 22일
Hello, I've written a MATLAB script that takes a bunch of user input data (things like diameter, efficiency, gain, etc), does calculations based on this data (using functions created in their own files), then displays the calculated numbers. My script functions fine, but I'm using this project as an opportunity to learn about MATLAB's App Designer. I would like to make an app with the functionality I just described that also has an easy UI.
So far, I have created the properties 'diameter' and 'efficiency'. I've created two numeric edit fields (in the design view) that allow the user to input these data values. I've also created a "Submit Data" button (with it's corresponding callback function) that allows the user to submit the entered data. In addition to all the houskeeping code that MATLAB automatically inserts for you, my additional code is listed below. Am I on the right track here? If so, what next steps do I need to take in order to start manipulating the input data for calculations? How (and where) can I integrate functions that I have already written into this code? Thanks in advance!
properties (Access = private)
diam; % Description
eff;
end
methods (Access = private)
% Button pushed function: SubmitDataButton
function SubmitDataButtonPushed(app, event)
app.diam = app.DiameterEditField.Value;
app.eff = app.EfficiencyEditField.Value;
end
end

답변 (1개)

TED MOSBY
TED MOSBY 2025년 8월 22일

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by