app designer says cosd "undefined function"

조회 수: 15 (최근 30일)
Isaac O'Neal
Isaac O'Neal 2019년 2월 1일
답변: Geoff Hayes 2019년 2월 1일
cosd not working in app designer. it works fine in matlab just not in the app designer. app designer says "undefined funtion"
  댓글 수: 5
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일
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개)

카테고리

Help CenterFile Exchange에서 Install Products에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by