MATLAB Answers

GUI for showing different figures with different data

2 views (last 30 days)
Michael Andersson
Michael Andersson on 25 Sep 2020
I have generated a script that is pulling signals from an oscilloscope and it generates 4 different figures (some with subplots) and each has labels, keys and limits. I would like to create a GUI (inserted at the bottom of my code) that simply shows one figure presented with a texted box underneath with some information relating to a particular figure. Then sampling changed the displayed figure with either the press of a keyboard key or with some buttons on the side of the GUI.
I have been looking into examples and tutorials, but haven’t yet found one that takes a previously generated 'completed' figures like this, and display one at a time.
xlabel('Time (s)');
ylabel('Volts (V)');
grid on;
legend(['Sampled data (Average)'],'Location','northeast','Orientation','horizontal');
plot(H,AllFFT_mean,'DisplayName','Oscilloscope Measured Signal'); hold on;
stem(X2,triH,':^m','BaseValue',-140); hold on;
stem(X2,sqrH,':sr','BaseValue',-140); hold on;
grid minor;
a1 = [1:40]';
b1 = num2str(AllPeaks2);
c1 = cellstr(b1);
text(X1, AllPeaks2, c1,'FontSize', 10, 'Rotation', 60,'HorizontalAlignment','left','VerticalAlignment','baseline');
xlabel('Frequency (Hz)');
ylabel('Voltage gain (dB)');
xlim([0 2020]);
hold off;
legend([ ]);
Alternative: I just need a way to display my figures in one full screen figure for presentation purposes with some way of tabbing between plots. So other methods outside of using a GUI might work too, but a GUI does look nicer.
Any thoughts and ideas as the best approach would greatly. Will post back if I get mine working.

Answers (1)

Manas Meena
Manas Meena on 30 Sep 2020
In my understanding you want to display your generated figures in an axes one by one using pushbuttons. You can refer to the following link to achieve this.
One potential workaround for displaying multiple images in a scrollable manner is explained in the following link
  1 Comment
Michael Andersson
Michael Andersson on 8 Oct 2020
Since I posted this, I stepped away from using a gui and just went with more basic methods of displaying all of my figures. However that second link you sent looks like a promising method.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!