arduino与matlab联调出现问题
生活随笔
收集整理的這篇文章主要介紹了
arduino与matlab联调出现问题
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1.問題描述
arduino讀取數(shù)據(jù)沒有問題,用matlab調(diào)用arduino的數(shù)據(jù)來畫圖時,說端口不可用,這里我使用的是(com4).
錯誤使用 serial/fopen (line 72)
打開失敗: Port: COM4 is not available. No ports are available.
Use INSTRFIND to determine if other instrument objects are connected to the requested device. 出錯 test (line 12)
fopen(s); %打開串口對象s
2.解決方法 這四句代碼寫在前面,作用是找到打開的端口并關(guān)閉和刪除,我是這樣理解的 if ~isempty(instrfind)
???? fclose(instrfind);
????? delete(instrfind);
end https://www.mathworks.com/matlabcentral/answers/257651-failed-to-open-serial-port-com3-to-communicate-with-board-uno
注意:不要在matlab代碼里寫clc 和clear,要不然畫出來的只是一個類似階躍信號的圖。clc和clear 可以在命令行里寫。
錯誤使用 serial/fopen (line 72)
打開失敗: Port: COM4 is not available. No ports are available.
Use INSTRFIND to determine if other instrument objects are connected to the requested device. 出錯 test (line 12)
fopen(s); %打開串口對象s
2.解決方法 這四句代碼寫在前面,作用是找到打開的端口并關(guān)閉和刪除,我是這樣理解的 if ~isempty(instrfind)
???? fclose(instrfind);
????? delete(instrfind);
end https://www.mathworks.com/matlabcentral/answers/257651-failed-to-open-serial-port-com3-to-communicate-with-board-uno
注意:不要在matlab代碼里寫clc 和clear,要不然畫出來的只是一個類似階躍信號的圖。clc和clear 可以在命令行里寫。
總結(jié)
以上是生活随笔為你收集整理的arduino与matlab联调出现问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 虚拟机ubuntu安装ssh服务器,经过
- 下一篇: matlab远程桌面访问:License