I have got "Error using serial/fopen (line 72) Open failed: Port: COM5 is not available. No ports are available. Use INSTRFIND to determine if other instrument objects are connected to the requested device. Error in viread (line 5) fopen (comport);"
8 views (last 30 days)
Show older comments
my code body is
clear all;
clc;
close all;
comport=serial('COM5','Baudrate',9600);
fopen (comport);
x=0;
while(x<100)
x=x+1;
v1(x)=fscanf(comport, '%d');
plot(v1,'r--','linewidth',3)
grid on;
hold on;
end
fclose(comport);
delete(comport);
1 Comment
Walter Roberson
on 26 Mar 2016
Is the arduino connected to COM5?
What happened when you use instrfind to find out what was already in use?
Answers (0)
See Also
Categories
Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!