How to use the Arduino with MATALB software

조회 수: 2 (최근 30일)
Louis Swaby
Louis Swaby 2021년 5월 28일
답변: Florian 2023년 3월 6일
I installed the MATLAB support package for Arduino Hardware but am unable to communicate with my arduino Uno. When setting up the board it says that the connection is good. However, when I try to use the example code below it does not work.
a = arduino();
I get the following error:
No constructor 'string' with matching signature found.
  댓글 수: 5
Rachel Mannasse
Rachel Mannasse 2023년 2월 2일
Did you ever fix this problem?
Elise Lutz
Elise Lutz 2023년 2월 20일
I'm having the same issue with no luck :(

댓글을 달려면 로그인하십시오.

답변 (3개)

Florian
Florian 2023년 3월 6일
Hi, as I had the same issue with my 2022b instalation, maybe my solution will help someone.
instead the non working
a = arduino()
use auto suggestion after the first bracket (TAB ) to input something like:
a = arduino("/dev/cu.usbmodem144301","Nano33IoT") %the pink stuff should be different for you
And now, at least for me, there is no error message

Walter Roberson
Walter Roberson 2021년 5월 28일
Which MATLAB release are you using?
What shows up for
which -all String
which -all string
The error message you are getting most commonly occurs when you are using a file system that is not case sensitive (NTFS and Apple HFS+ by default are not case sensitive), and you have a function defined with the other cases than the class you are trying to invoke. So in this case, if you had a String.m on your MATLAB path that was earlier than MATLAB's @string folder, then the String.m might get matched because the file system is not case sensitive, but then MATLAB internally compares the String name to the desired string and sees they are different and gives the error message you indicated.
  댓글 수: 5
Walter Roberson
Walter Roberson 2022년 10월 5일
Try with
dbstop if caught error
Dylan McSweeney
Dylan McSweeney 2022년 10월 14일
>> a = arduino();
No constructor 'string' with matching signature found.
>> which -all String
/Applications/MATLAB_R2022b.app/toolbox/matlab/strfun/@string/string.m % string constructor
/Applications/MATLAB_R2022b.app/toolbox/matlab/datatypes/@opaque/string.m % opaque method
/Applications/MATLAB_R2022b.app/toolbox/matlab/bigdata/@tall/string.m % tall method
/Applications/MATLAB_R2022b.app/toolbox/matlab/codetools/@mtree/string.m % mtree method
/Applications/MATLAB_R2022b.app/toolbox/matlab/datatypes/categorical/@categorical/string.m % categorical method
>>
>> dbstop if caught error
>> a = arduino()
Caught-error breakpoint was hit in base>base.addprop at line 0. The error was:
'dhardwareInstance' is already defined as a property.
In workspace belonging to arduino
K>>

댓글을 달려면 로그인하십시오.


Zoltán
Zoltán 2022년 10월 7일
Same for me, seems to be an Apple Monterey problem.

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by