푸시 버튼 콜백과 2 개의 편집 상자가있는 GUI가 MATLAB (GUIDE를 사용하여 생성)에 있습니다. 먼저 편집 상자를 채우고 푸시 버튼을 누르면 축 쌍에 그림이 그려집니다.MATLAB의 GUI에서 함수에서 콜백 함수로 데이터를 전송하는 중
이 푸시 버튼을 누르면 편집 상자 데이터의 데이터를 마이크로 컨트롤러로 직렬 전송하고 전송 된 데이터를 기반으로 계산 된 데이터를 수신하는 .m 파일을 실행합니다. 이 데이터는 마이크로 컨트롤러에서 다시 전송 된 직렬 데이터를 처리하는 별도의 다른 기능 파일에서 생성됩니다.
이제이 데이터를 푸시 버튼 콜백 함수로 전송하여 한 쌍의 축에 플롯 할 수 있습니다. 어떻게합니까 전역 변수없이 ? 문제는 마이크로 컨트롤러에서 시리얼 데이터를 수신 할 때마다 플롯을 지속적으로 업데이트해야한다는 사실 때문에 복잡합니다.
푸시 버튼 콜백에 대한 개요는 다음과 같습니다 :
% --- Executes on button press in angle_speed_pushbutton_callback.
function angle_speed_pushbutton_callback_Callback(hObject, eventdata, handles)
% hObject handle to angle_speed_pushbutton_callback (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
angle1 = handles.xy_angle; %These values are obtained from the edit boxes
angle2 = handles.xz_angle;
delay = handles.speed;
Testbed_Calibration_main; %Main function which sends data serially to the microcontroller
% I want to transfer the data received by the function which handles the microcontroller output here
% plot transferred data on axes here
미리 감사드립니다. :-)