I need the graph to be plotted inside the axes of GUI instead of popping out.
2 ビュー (過去 30 日間)
古いコメントを表示
Chandrika Avvaru
2018 年 7 月 13 日
コメント済み: Walter Roberson
2018 年 7 月 17 日
% --- Executes on button press in correlation.
function correlation_Callback(hObject, eventdata, handles)
% hObject handle to correlation (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%eeg_data=str2double(get(handles.input,'String'
# * Item one
# * Item two));
if isfield(handles,'window_orig')
disp('Correlation is being calculated...')
[c d]=size(handles.eeg_data);
TH_corr=handles.TH_corr;
[correlation,y1]=correla(handles.window_orig,c,TH_corr);
handles.correlation=correlation;
handles.y1=y1;
handles.axes1=y1;
% [p q]=size(handles.correlation);
guidata(hObject,handles)
disp(handles)
else
disp('No Data Found!!!')
end
function [correlation,y1]=correla(window,c,TH_corr)
for h=1:c
for l=1:c
X=window(h,:);
Y=window(l,:);
ca=corr2(X,Y);
corr(h,l)=round(ca,2);
end
correlation=corr;
end
[p,q]=size(correlation);
for j=1:(p*q)
if(corr(j)< TH_corr && corr(j) > -TH_corr)
corr(j)=0;
end
end
disp('graph is being plotted....')
figure;
x3=graph(corr,'upper','OmitSelfLoops');
LWidths2= 5*x3.Edges.Weight/max(x3.Edges.Weight);
n1={'C3','C4','Cz','F3','F4','O1','O2','P3','P4','T3','T4'};
y1=plot(x3,'EdgeLabel',x3.Edges.Weight,'LineWidth',abs(LWidths2),'Layout','auto','NodeLabel',n1);
y1.Marker='s';
y1.NodeColor='r';
y1.MarkerSize=6;
y1.EdgeAlpha=0.3;
disp('Correlation is calculated')
0 件のコメント
採用された回答
Walter Roberson
2018 年 7 月 17 日
Remove the
figure;
call.
5 件のコメント
Walter Roberson
2018 年 7 月 17 日
If you have a handle graphics object, then it would already be displayed unless the visibility of the object (or perhaps a container of the object) is set to Off. Unless, that is, what you stored in handles was data rather than the graphics object?
If you have an existing handle graphics object but you need to move it to a different container, then you can set its Parent property. If you have an existing handle graphics object but you need to copy it to a different container, then you can copyobj()
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Specifying Target for Graphics Output についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!