Error using subplot, undefined function or variable

5 Ansichten (letzte 30 Tage)
Dario
Dario am 14 Mär. 2018
Beantwortet: Alok Nimrani am 27 Mär. 2018
I'm using in a wrong way subplots. I want to plot two matrices in the same figure using two subplots.
figure
subplot(2,1,1);
plot(valmedio,'DisplayName','valmedio')
set(gca,'XTick', [0,50,100,150,200,250,300]);
set(gca,'XTickLabel',[0,1000,2000,3000,4000,5000,6000]);
legend('Location','northwest')
grid minor
title('Plot valmedio 0 ÷ 6 Km.')
sublpot(2,1,2);
plot(valmedio(1:30,:),'DisplayName','valmedio')
set(gca,'XTick', [0,5,10,15,20,25]);
set(gca,'XTickLabel',[0,100,200,300,400,500,600]);
legend('Location','northwest')
grid minor
title('Plot valmedio 0 ÷ 600 m.')
  3 Kommentare
Jan
Jan am 20 Mär. 2018
@Ana: If you open a FIG file in R2017a and save the GUI afterwards, it might not open in earlier versions anymore. The dialogs created by GUIDE are not compatible with other Matlab versions.
Rik
Rik am 20 Mär. 2018
Also, ishg2parent seems to be undocumented (about the only hits on Google are from Yair Altman, there is no reference to this function in the release notes, and my R2017b doesn't recognize that function either).
It might also be an internal function somewhere buried deep, as it looks like it is a subfunction of legend in R2014b, but in my copy it is no longer there.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Alok Nimrani
Alok Nimrani am 27 Mär. 2018
Hi Dario,
The reason for the error is the function ‘subplot()’ being spelled incorrectly as SUBLPOT in line 10. On correcting this function call, I am getting two subplots in the output figure.
Hope this helps.
Thanks

Community Treasure Hunt

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

Start Hunting!

Translated by