Info

This question is closed. Reopen it to edit or answer.

Serial port error in script file

1 view (last 30 days)
nerd
nerd on 2 May 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
Hello all,
I'm trying to control my arduino due with matlab. The arduino is progammed so that when it receives a letter 'd' on the serial input it will do a cyclus with my stepper motor. The program is working in arduino! When i tried in Matlab it also work, but ONLY if i manually put in the code(command window). When making a new script, i get error's that my COM port isn't found (or the program isn't found)! This is right after i tested the command window (nothing is closed or USB isn't removed)
the matlab code is so simple that you can't do anything wrong : s = serial('COM14','BaudRate', 9600); fopen(s) fwrite(s,'d');
As you can see i didn't closed it (yeahyeah i know :D) with the simple reason it have to be used when needed and doens't need to be closed!
anyone that know what can be the possible reason? Many thanks!

Answers (0)

Community Treasure Hunt

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

Start Hunting!