フィルターのクリア

Function not recognising output

2 ビュー (過去 30 日間)
Holden Earl
Holden Earl 2020 年 5 月 8 日
回答済み: Walter Roberson 2020 年 5 月 8 日
i am trying to make a user defined function for a unit converter in app designer. i have set up my code but when i run it the output ('num') says it is not recognised even though i have stated it is the output in the first line, do i need to do something else to this variable that i am missing? this is my code
function num = convert_func(x,conversion)
if conversion == 1
num = x/0.4536;
elseif conversion ==2
num = x*0.4536;
end
i also get this error message in app designer
Output argument "num" (and maybe others) not assigned during call to "convert_func"

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 5 月 8 日
conversion is something other than 1 or 2, or else it is non-scalar and has both values

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by