【发布时间】:2014-02-20 04:30:09
【问题描述】:
我正在尝试绘制一些基本图表,时间与速度、时间与加速度、速度与加速度,但我不明白为什么这些数字会出现在每张图表上。我尝试通过几种方法更改标签,但似乎并没有让它们消失。
clc
clear
disp('Jack Abdo');
disp('Engr Course 297 12441');
disp('Matlab Homework 8 problem #4');
disp('This script graphs output data from a UDP');
ourinput = [0 0];
ourinput(1) = input('Please enter the beginning time.');
ourinput(2) = input('Please enter the ending time.');
time = [ourinput(1):5:ourinput(2)]
velocity = 0.00001*time.^3 - 0.00488*time.^2 + 0.75795*time + 181.3566
acceleration = 3 - 0.000062*velocity.^2
subplot(5,1,1);
plot(time,velocity);
xlabel(time);
ylabel(velocity);
grid;
title('Velocity vs Time');
set(gca,'XTick',0:30:120)
set(gca,'YTick',180:10:220)
subplot(5,1,2);
plot(time,acceleration);
xlabel(time);
ylabel(acceleration);
grid;
title('Acceleration vs Time');
set(gca,'XTick',0:30:120)
set(gca,'YTick',0:5:1)
subplot(5,1,1);
plot(velocity, acceleration);
xlabel(velocity);
ylabel(acceleration);
grid;
title('Acceleration vs Velocity');
axis auto;
【问题讨论】:
-
最后不正确的是我忘记了关于时间、加速度和速度的引号。