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!

