run script from desktop shortcut vs command window
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!