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)
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);

Answers (0)

Categories

Find more on MATLAB Support Package for Arduino Hardware in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!