Very strange situation. By some reason the questdlg() does not work within a function:

4 ビュー (過去 30 日間)
Sergey Lopatnikov
Sergey Lopatnikov 2019 年 11 月 21 日
コメント済み: Stephen23 2019 年 11 月 21 日
Very strange situation. By some reason the questdlg() does not work within a function:
function = Heat_Test()
answer = questdlg('quest')
end
Got result:
>> Heat_Test()
Error: File: Heat_Test.m Line: 1 Column: 11
Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.
Outside the function works normally
  1 件のコメント
Stephen23
Stephen23 2019 年 11 月 21 日
"Very strange situation."
Not very strange at all, your function syntax is incorrect:
function = Heat_Test()
% ^^

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

回答 (1 件)

Henry Giddens
Henry Giddens 2019 年 11 月 21 日
Your function definition is wrong. Try
function answer = Heat_Test()
answer = questdlg('quest')
end

カテゴリ

Help Center および File ExchangeDialog Boxes についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by