Why doesn't serial object work in compiled application with MATLAB 2015a?
Show older comments
I compiled succesfully a standlone application with the MCR included, but when I install and run the application in other computer, the application throw an error: undefinedVarOrClass
This is the code:
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
try
com='COM6';
delete(instrfind({'Port'},{com}));
f=serial('COM6','BaudRate',9600);
fopen(f);
pause(2);
fprintf(f,'%s','F');
fclose(f);
catch ME
warndlg(ME.identifier);
end
Note: I used GUI of matlab.
Answers (0)
Categories
Find more on C Shared Library Integration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!