Why is "hold on" messing up my plot and how do i get rid of the straight line on 0
Show older comments
The Excel file is a just a two column sheet of numbers, but i dont know why when i use hold on it puts my three *'s on 0? but at the proper y value. any ideas? Also there is a line on the x axis from 0-400any ideas on why that is?
thanks
t = (0:.002:1);
Vo = -.5;
Vi = .5;
tau = .2;
Vc = Vi + (Vo - Vi)* exp(-t/tau);
%Above is the theoretical equation and parameters.
x = xlsread('2_2.xlsx');
%this reads in excel file of measured points.
r = [1.43E-05 0.000580299 0.000186299];
c = [-0.4175 0.42798 0.08351];
%This is used to plot the three points.
figure(1)
plot(Vc,'green');
hold on
plot(x,'blue');
plot(r,c,'*');
title('Response of a first-order System');
legend('Theoretical','Measuured');
xlabel('Time');
ylabel('Volts');
Accepted Answer
More Answers (0)
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!