【问题标题】:Error plot2D GUI MATLAB错误 plot2D GUI MATLAB
【发布时间】:2025-11-28 20:50:01
【问题描述】:

我有这个代码:

h=plot(elapsedTime(1:length(elapsedTime)),velocityMagnitudeCentroide,'Parent',handles.grafico s2D)h=plot(elapsedTime(1:length(elapsedTime)),velocityMagnitudeCentroide,'Parent',handles.graficos2D);

hhTitle=title(gca,'Head Filtered 3D Velocity');
hhXLabel=xlabel(gca,'time(s)');
hhYLabel=ylabel(gca,'Velocity (m/s)');
hLegend = legend(h,'Head');

z=plot3(x3D,y3D,z3D,'Parent',handles.graficos3D);
set(handles.ui_label1, 'String', 'Max');
set(handles.ui_label2, 'String', 'Mean');
set(handles.ui_label3, 'String', 'Min');

hTitle=title('3D Position');
hXLabel=xlabel('time(s)');
hYLabel=ylabel('3D Position(m)');

输出这个:

我做错了什么?

【问题讨论】:

  • 问题:在二维绘图中,轴的标题和名称不显示!
  • 已经找到答案了……
  • answer: hhTitle=title(handles.graficos2D,'Head Filtered 3D Velocity');
  • 请通过在您的帖子下方放置答案来回答您自己的问题,或者将帖子一并删除。

标签: matlab user-interface plot matlab-figure


【解决方案1】:

已经想通了..

回答:hhTitle=title(handles.graficos2D,'Head Filtered 3D Velocity');

当他有两个或更多的情节时,Matlab 是敏感的。所以你需要“实际上”命名你想要绘制的情节。

【讨论】: