Undefined function 'writePosition' for input arguments of type 'double'
이전 댓글 표시
Hi, I have followed the guide from this page (https://www.mathworks.com/help/supportpkg/arduinoio/ug/control-servo-motors.html) on how to set up the servo motor via Arduino on Matlab.
However, I keep getting the following the error message: Undefined function 'writePosition' for input arguments of type 'double'
This page (https://www.mathworks.com/help//supportpkg/arduinoio/ref/writeposition.html) states that the writePosition function can take in any numeric value from 0 to 1, but yet the error shows up.
Why is this happening?
My code is as shown below:

Thank you.
댓글 수: 7
madhan ravi
2019년 1월 18일
Do you have arduino hardware support package installed?
Kin Sun Wong
2019년 1월 18일
madhan ravi
2019년 1월 18일
편집: madhan ravi
2019년 1월 18일
which version are you using 2018a?
Kin Sun Wong
2019년 1월 18일
Kin Sun Wong
2019년 1월 18일
madhan ravi
2019년 1월 18일
I mean which release are you using 2018 a ?
Kin Sun Wong
2019년 1월 18일
답변 (2개)
madhan ravi
2019년 1월 18일
change
function interval(x)
to
function interval
댓글 수: 14
Kin Sun Wong
2019년 1월 18일
madhan ravi
2019년 1월 18일
편집: madhan ravi
2019년 1월 18일
Type the below in command window:
which writePosition -all % what shows up?
Kin Sun Wong
2019년 1월 18일
Kin Sun Wong
2019년 1월 18일
madhan ravi
2019년 1월 18일
편집: madhan ravi
2019년 1월 18일
what's the value of s?
Kin Sun Wong
2019년 1월 18일
Kin Sun Wong
2019년 1월 18일
madhan ravi
2019년 1월 18일
uncomment the two lines before global a , see that's why global is not recommended making it harder to debug!!!
Kin Sun Wong
2019년 1월 18일
madhan ravi
2019년 1월 18일
remove global a and global s
Kin Sun Wong
2019년 1월 18일
madhan ravi
2019년 1월 18일
편집: madhan ravi
2019년 1월 18일
how are you calling it ? by pressing the green triangle button ?can you upload the code?
Kin Sun Wong
2019년 1월 18일
madhan ravi
2019년 1월 18일
oh good , glad that you found , anytime :)
amin ali
2021년 9월 11일
0 개 추천
hello
can you help me
카테고리
도움말 센터 및 File Exchange에서 Arduino Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

