Error using subplot, undefined function or variable

15 次查看(过去 30 天)
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 个评论
Jan
Jan 2018-3-20
@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 2018-3-20
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.

请先登录,再进行评论。

回答(1 个)

Alok Nimrani
Alok Nimrani 2018-3-27
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