I am trying to store values from serial monitor of Arduino to a vector in MATLAB.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
if true
% code
end
function pushbutton1_Callback(hObject, eventdata, handles)
delete(instrfind)
theta=zeros(1,100000);
arduin=serial('COM3','BaudRate',9600); % create serial communication object on port COM18
fopen(arduin); % initiate arduino communication
CM(1)=0;
time(1)=0;
tic;
while (toc<=60) % stop after 60 secs
for i=1:100
theta(i)=fscanf(arduin,'%f');
end
end
fclose(arduin); % end communication with arduino
delete(arduin);
guidata(hObject, handles); It generates an error: Error in fyp>pushbutton1_Callback (line 90) theta(i)=fscanf(arduin,'%f');
Error in gui_mainfcn (line 95) feval(varargin{:});
Error in fyp (line 42) gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)fyp('pushbutton1_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!