how would i write script to graph the 't' and 'y' values?

figure;
load('ALL_DATA.mat','Box40');
subplot(3,1,1);
plot();
legend('t','y');
title('Testbox');

Answers (2)

Read about plot function.
plot(t,y);
xlabel('t')
ylabel('y')
figure;
load('ALL_DATA.mat','Box40');
subplot(3,1,1);
% use the struct name to access the t & y variables
plot(Box40.t,Box40.y);
legend('t','y');
title('Testbox');

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Asked:

on 3 Mar 2022

Answered:

on 11 Apr 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!