Info

This question is closed. Reopen it to edit or answer.

Updating GUI axes with a figure from disk.

1 view (last 30 days)
Cameron Stewart
Cameron Stewart on 9 Jul 2015
Closed: MATLAB Answer Bot on 20 Aug 2021
Hello,
I am trying to write a UI for some structural analysis. I have got the UI to receive inputs and do all the calculation but I am having trouble getting the UI to display the figure produced. (The figure has been attached for reference).
Within the callback for 'centreView_menuItem_Callback' I am trying to update handles.axes1 to the handle for the figure (saved in the same directory). I am able to plot a sine function in the viewport, but I cannot get it to display the figure.
What am I missing?
Kind Regrds, Cameron
function centreView_menuItem_Callback(hObject, eventdata, handles)
% hObject handle to centreView_menuItem (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
x = 1:10
y = sin(x)
hfig = openfig('currentFig.fig');
%plot(handles.axes1, x,y)
plot(handles.axes1, hfig)

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!