cosd not working in app designer. it works fine in matlab just not in the app designer. app designer says "undefined funtion"

5 件のコメント

Sean de Wolski
Sean de Wolski 2019 年 2 月 1 日
Can you show the full error message?
John D'Errico
John D'Errico 2019 年 2 月 1 日
I wonder if it might have been something along these lines:
cosd(uint8(1))
Undefined function 'cosd' for input arguments of type 'uint8'.
Isaac O'Neal
Isaac O'Neal 2019 年 2 月 1 日
Undefined function 'cosd' for input arguments of type 'matlab.ui.control.NumericEditField'.
Geoff Hayes
Geoff Hayes 2019 年 2 月 1 日
Isaac - please show us how you are using/calling cosd. It sounds like you are passing in a control rather than a (numeric) angle.
Isaac O'Neal
Isaac O'Neal 2019 年 2 月 1 日
Screen Shot 2019-01-31 at 6.03.26 PM.png

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

 採用された回答

Geoff Hayes
Geoff Hayes 2019 年 2 月 1 日

3 投票

Isaac - you are obtaing the angle as
angle = app.Angle;
where presumably Angle is the handle to the matlab.ui.control.NumericEditField and so is not the angle itself. You may need to do someting more like
angle = app.Angle.Value;
to get the value of the angle. (I'm assuming that since this is a NumericEditField, you don't have to convert the above from a string to a number.)
Note that if the above works, you will need to do the same for the initial population and initial velocity.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Creating, Deleting, and Querying Graphics Objects についてさらに検索

質問済み:

2019 年 2 月 1 日

回答済み:

2019 年 2 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by