Undefined function 'writePosition' for input arguments of type 'double'
Mostrar comentarios más antiguos
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 comentarios
madhan ravi
el 18 de En. de 2019
Do you have arduino hardware support package installed?
Kin Sun Wong
el 18 de En. de 2019
madhan ravi
el 18 de En. de 2019
Editada: madhan ravi
el 18 de En. de 2019
which version are you using 2018a?
Kin Sun Wong
el 18 de En. de 2019
Kin Sun Wong
el 18 de En. de 2019
madhan ravi
el 18 de En. de 2019
I mean which release are you using 2018 a ?
Kin Sun Wong
el 18 de En. de 2019
Respuestas (2)
madhan ravi
el 18 de En. de 2019
change
function interval(x)
to
function interval
14 comentarios
Kin Sun Wong
el 18 de En. de 2019
madhan ravi
el 18 de En. de 2019
Editada: madhan ravi
el 18 de En. de 2019
Type the below in command window:
which writePosition -all % what shows up?
Kin Sun Wong
el 18 de En. de 2019
Kin Sun Wong
el 18 de En. de 2019
madhan ravi
el 18 de En. de 2019
Editada: madhan ravi
el 18 de En. de 2019
what's the value of s?
Kin Sun Wong
el 18 de En. de 2019
Kin Sun Wong
el 18 de En. de 2019
madhan ravi
el 18 de En. de 2019
uncomment the two lines before global a , see that's why global is not recommended making it harder to debug!!!
Kin Sun Wong
el 18 de En. de 2019
madhan ravi
el 18 de En. de 2019
remove global a and global s
Kin Sun Wong
el 18 de En. de 2019
madhan ravi
el 18 de En. de 2019
Editada: madhan ravi
el 18 de En. de 2019
how are you calling it ? by pressing the green triangle button ?can you upload the code?
Kin Sun Wong
el 18 de En. de 2019
madhan ravi
el 18 de En. de 2019
oh good , glad that you found , anytime :)
amin ali
el 11 de Sept. de 2021
0 votos
hello
can you help me
Categorías
Más información sobre Arduino Hardware en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

