creating a figure that is a segment of another
Mostra commenti meno recenti
i have a script that gives my figure(1) that graphs a cos wave over 5 sec then i need to section out the first second and have it display in figure(2). when i run my script i get the first figure and the second only displays the x,y cooridinates.
i think i have a problem in the way i sectioned the original vector.
my script looks like this:
clear;
clc;
close all;
% create vector of time values
t = 0.0 : 0.01 : 5.0;
% evaluate function at time points
f = 53*cos(104*pi*t).*exp(-1.35*t);
% plot t vs f(t)
figure(1)
plot(t,f);
xlabel('t(sec)');
ylabel('f(t)');
%reindex t to exclude the last four seconds
t = 0.0 : 0.01 : 5;
%plot t vs f(t)
figure(2)
plot(t,f(t));
xlabel('t(sec)');
ylabel('f(t)');
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Creating, Deleting, and Querying Graphics Objects in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!