For Matlab for Engineers, author Holly Moore, chapter 8, problem 8, I do not und
ID: 2080412 • Letter: F
Question
For Matlab for Engineers, author Holly Moore, chapter 8, problem 8, I do not understand why my graph is not displaying two black lines I have commanded that represent the average of September and February. What code is off?
x = year;
y1 = sept_avg;
y2 = feb_avg;
figure(4)
yyaxis left
plot(x,y1)
xlabel('year')
ylabel('September')
yyaxis right
plot(x,y2)
ylabel('February')
hold on
s_avg = 18.79; % million square kilometers
f_avg = 3.04; % million square kilometers
x2 = [1979:2010];
plot(x2,s_avg,'-k',x2,f_avg,'-k')
hold off
title('Ice Extent of the Antarctic Sea')
xlabel('year')
ylabel('September')
ylabel('February')
legend('Sept','Feb','1979-2010 avg','1979-2010 avg')
Explanation / Answer
May be in your MATLAB version yyaxis right or yyaxis left commands are not working. due to this plot is not displaying.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.