I am unable to label the y axis of a graph.

2 views (last 30 days)
I have been trying to label the axis of a graph that I was plotting.
My code:
A = xlsread("GM_Time_History.xlsx");
x = A(:,1);
y = A(:,2);
i = (pi/2*9.81).*cumtrapz(y.^2);
figure;
plot(x,i);
xlabel('Time(sec)')
ilabel('AI')
The output graph only has the x axis labelled.
The error I am seeing is:
Unrecognized function or variable 'ilabel'.
Error in AriasIntensity (line 9)
ilabel('AI')

Accepted Answer

Cris LaPierre
Cris LaPierre on 7 Nov 2022
MATLAB does not contain an ilabel function. It looks like you want to use ylabel instead.
A = xlsread("GM_Time_History.xlsx");
x = A(:,1);
y = A(:,2);
i = (pi/2*9.81).*cumtrapz(y.^2);
figure;
plot(x,i);
xlabel('Time(sec)')
ylabel('AI')

More Answers (0)

Categories

Find more on Line Plots in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by