Why doesn't serial object work in compiled application with MATLAB 2015a?

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.

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Compiler についてさらに検索

質問済み:

2017 年 9 月 27 日

編集済み:

2017 年 9 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by