現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
Run script file from App designer
11 ビュー (過去 30 日間)
古いコメントを表示
I succeed in run my script file from the app designer but the problem is, it runs in command window and when I ask to show result it shows the old one on the workspace
13 件のコメント
Rik
2022 年 5 月 10 日
Why are you using a script for anything serious? You should be using functions instead, as those provide a stable interface.
Ayman Shaban
2022 年 5 月 10 日
Actualiy I'm using functions and call them in these scripts, I don't know if I can call func in func !
Rik
2022 年 5 月 10 日
You can absolutely call a function from within a function. So you don't need to use a script at any point.
Ayman Shaban
2022 年 5 月 11 日
ok, I did that but I stil have the same problem, app designer give me error because it can't find 'result' in the workspace to show it in the editfield
cr
2022 年 5 月 12 日
In the function where you are computing the result, copy it to main workspace using eval(). e.g. if result is a scalar, eval(['result=' num2str(result)]). This would make the variable available in main workspace. Another way is to use global variables.
Note that both these are less efficient ways of dealing with variable scopes.
Rik
2022 年 5 月 12 日
How are you calling your function? It sounds like you should set that variable as the output argument of your function.
You should not need eval or global. There are almost always better ways.
Ayman Shaban
2022 年 5 月 12 日
% Button pushed function: ResultButton
function ResultButtonPushed(app, event)
TestPenchCode3 %calling function
Result = evalin('base' , 'ans');
app.EditField.Value = Result;
end
Rik
2022 年 5 月 12 日
You should edit your function so you can actually retrieve the output and call it like this:
% Button pushed function: ResultButton
function ResultButtonPushed(app, event)
Result = TestPenchCode3; %calling function
app.EditField.Value = Result;
end
You never need to use eval.
Ayman Shaban
2022 年 5 月 12 日
I have another Q, I'm working on matlab code for detecting speech disorder, I've five classes each class is 220 sounds, so I use calssification learner in matlab with some features(statistic features, spectrm and MFCCs), The problem is that the accuracy of classifier is weak (about 75%), do you know how I increase it.
Rik
2022 年 5 月 13 日
I'm afraid I can't help you with that. The answer will depend on your exact method and data. You could try opening a new question.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)