Professional Documents
Culture Documents
Code Subplot
Code Subplot
% Create figure
figure1 = figure('Color',...
[0.800000011920929 0.800000011920929
0.800000011920929]);
% Create subplot
subplot1 = subplot(2,1,1,'Parent',figure1);
hold(subplot1,'on');
% Create plot
plot(X1,Y1,'Parent',subplot1,'LineWidth',2);
% Create ylabel
ylabel('Distance(m)');
% Create xlabel
xlabel('Temps(s)');
box(subplot1,'on');
% Set the remaining axes properties
set(subplot1,'FontSize',12,'FontWeight','bold','XGri
d','on','YGrid','on');
% Create subplot
subplot2 = subplot(2,1,2,'Parent',figure1);
hold(subplot2,'on');
% Create plot
plot(X1,Y2,'Parent',subplot2,'LineWidth',2,'Color',
[1 0 0]);
% Create ylabel
ylabel('Vitesse(m/s)');
% Create xlabel
xlabel('Temps(s)');
box(subplot2,'on');
% Set the remaining axes properties
set(subplot2,'FontSize',12,'FontWeight','bold','XGri
d','on','YGrid','on');