- #1
satinysol
- 14
- 0
I want to display a real time signal from ECG
I use simulink block -scope and want it to be display in gui axes
This is a code from some other guy
function Command1_Callback(hObject, eventdata, handles)
button_state = get(hObject,'Value');
if strcmp(get(handles.Command1,'String'),'Start Recording') && (button_state == get(hObject,'Max'))
% toggle button is depressed
set(handles.Command1,'Enable','on');
set(hObject,'String','Stop Recording');
%open_system('simu');
set_param('simu','SimulationCommand','Start');
axes(handles.axes1);
set(handles.axes1,'XMinorTick','on');
grid on;
elseif strcmp(get(handles.Command1,'String'),'Stop Recording') && (button_state == get(hObject,'Max'))
set(handles.Command1,'Enable','on');
set(hObject,'String','Start Recording');
set_param('simu','SimulationCommand','Stop');
cla(handles.axes1,'reset');
guidata(hObject, handles); %updates the handles
end
But it doesn't work for my GUI , i don't know why ,can anyone tell which code is the input for simulink block and if there is any mistake please mention it.Thanks
I use simulink block -scope and want it to be display in gui axes
This is a code from some other guy
function Command1_Callback(hObject, eventdata, handles)
button_state = get(hObject,'Value');
if strcmp(get(handles.Command1,'String'),'Start Recording') && (button_state == get(hObject,'Max'))
% toggle button is depressed
set(handles.Command1,'Enable','on');
set(hObject,'String','Stop Recording');
%open_system('simu');
set_param('simu','SimulationCommand','Start');
axes(handles.axes1);
set(handles.axes1,'XMinorTick','on');
grid on;
elseif strcmp(get(handles.Command1,'String'),'Stop Recording') && (button_state == get(hObject,'Max'))
set(handles.Command1,'Enable','on');
set(hObject,'String','Start Recording');
set_param('simu','SimulationCommand','Stop');
cla(handles.axes1,'reset');
guidata(hObject, handles); %updates the handles
end
But it doesn't work for my GUI , i don't know why ,can anyone tell which code is the input for simulink block and if there is any mistake please mention it.Thanks
Attachments
Last edited: