run script from desktop shortcut vs command window

4 Ansichten (letzte 30 Tage)
Jim
Jim am 3 Mai 2016
I set up a shortcut icon on my desktop to execute the following -
C:\Program Files\MATLAB\R2016a\bin\matlab.exe" -nodesktop -nosplash -minimize -r matlabserial
Matlabserial.m opens a serial com port and reads NMEA data from a GPS receiver.
When I launch the shortcut everything opens and the script runs to the point where I look for data on the serial port. The script then times out with no data received.
If I type matlabserial in the Matlab command window the script executes without a problem.
I put a disp('looking') command right before the lines
data1 = fgetl(obj1); % GGA
data2 = fgetl(obj1); % ATT
when launched from the shortcut I get one response. When launched from the command window a response for every time it finds the lines of data on the serial port.
I checked the path and all my subdirectories and toolkits showup.
Is the desktop shortcut not allowing the serial ports to work?

Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by