How do I take input through the editbox in GUI and then pass the data in a script(.m) file?

4 ビュー (過去 30 日間)
I am developing a GUI where I will be taking inputs from the user and then use the input data in the code I have written earlier such that upon clicking the pushbutton my code should run and give output.
  2 件のコメント
Animesh Anand
Animesh Anand 2022 年 5 月 16 日
Above snap is a part of the code for which inputs are to be taken. For example: joint_plane_dip = User data
This is the GUI.
I am not using App Designer. i am going the basic way.

サインインしてコメントする。

採用された回答

Geoff Hayes
Geoff Hayes 2022 年 5 月 16 日
@Animesh Anand - you will need to convert your code from a script (if that is what it is) to a function so that you define the correct input parameters that will be passed from your GUI to the function. For example, you will need to define the signature as
function estimateSupportForce(jointPlaneDip, slopFaceDip, slopeHeight, tensionCrackDepth, supportForceAngle, meanPhi)
and then call this function from the GUI and pass the parameters in the correct order. You can change these parameter names to match that in your code (i.e. jointPlaneDip is joint_plane_dip, etc.)

その他の回答 (0 件)

カテゴリ

Find more on Migrate GUIDE Apps in Help Center and File Exchange

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by