Calling a number from an edit in a uicontrol in a separate function

1 回表示 (過去 30 日間)
Spencer Brabec
Spencer Brabec 2021 年 5 月 2 日
編集済み: Cris LaPierre 2021 年 5 月 3 日
I am trying to pull a number out of the string in the postion below and input into a second function to be used to solve an equation
this is what I currently have
function[] = FinalProject()
clc
global vendor;
vendor.W1 = 0;
vendor.LengthWDisplay = uicontrol('style','text','units','normalized',...
'position', [.034 .80 .09 .095],'string','Input length W','horizontalalignment','right');
vendor.W1 = uicontrol('style','edit','units','normalized','position',...
[.15 .80 .09 .05],'string','edit','horizontalalignment','right');
function [] = solve()
global vendor;
W1 = str2num(vendor.W1.string);
If i need to explain this more then I can

回答 (1 件)

Cris LaPierre
Cris LaPierre 2021 年 5 月 3 日
編集済み: Cris LaPierre 2021 年 5 月 3 日
It looks like you are trying to build an app programmatically. If you haven't already done so, I recommend looking at this example.
Without more context, I'd recommend you use app designer.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by