run script from desktop shortcut vs command window

조회 수: 4 (최근 30일)
Jim
Jim 2016년 5월 3일
편집: Walter Roberson 2016년 5월 3일
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?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by