Y double axis required trendlines
x = [1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020];
y1 = [18.1969 15.834 16.5986 3.1579 10.9866 8.2062 8.9229 9.6429 6.4604 14.805 9.1178 0.49 2.9925 8.7875 5.7404 5.365 8.32 13.025 10.9654 3.26 8.975 4.795 0.97 32.3175 11.1025 0.65 9.5425 12.115 9.8975 21.875 16.6925];
y2 = [17.360463 15.30933 12.563672 2.174533 8.407282 5.828774 4.764783 5.524783 3.644908 15.515 7.022406 0.1715 1.168625 4.729125 3.232158 2.149 6.37575 12.0585 7.024658 1.355 5.591 3.088 0.396 25.004125 8.130375 0.2355 5.040375 7.95375 5.477375 18.4155 16.567625];
figure(‘Color’,’w’)
[hAx,hLine1,hLine2] = plotyy(x,y1,x,y2);
ylabel(hAx(1),’ACE (knot^2)’) % left y-axis
ylabel(hAx(2),’PDI (knot^3)’) % right y-axis
%grid onx = [1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020];
y1 = [18.1969 15.834 16.5986 3.1579 10.9866 8.2062 8.9229 9.6429 6.4604 14.805 9.1178 0.49 2.9925 8.7875 5.7404 5.365 8.32 13.025 10.9654 3.26 8.975 4.795 0.97 32.3175 11.1025 0.65 9.5425 12.115 9.8975 21.875 16.6925];
y2 = [17.360463 15.30933 12.563672 2.174533 8.407282 5.828774 4.764783 5.524783 3.644908 15.515 7.022406 0.1715 1.168625 4.729125 3.232158 2.149 6.37575 12.0585 7.024658 1.355 5.591 3.088 0.396 25.004125 8.130375 0.2355 5.040375 7.95375 5.477375 18.4155 16.567625];
figure(‘Color’,’w’)
[hAx,hLine1,hLine2] = plotyy(x,y1,x,y2);
ylabel(hAx(1),’ACE (knot^2)’) % left y-axis
ylabel(hAx(2),’PDI (knot^3)’) % right y-axis
%grid on x = [1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020];
y1 = [18.1969 15.834 16.5986 3.1579 10.9866 8.2062 8.9229 9.6429 6.4604 14.805 9.1178 0.49 2.9925 8.7875 5.7404 5.365 8.32 13.025 10.9654 3.26 8.975 4.795 0.97 32.3175 11.1025 0.65 9.5425 12.115 9.8975 21.875 16.6925];
y2 = [17.360463 15.30933 12.563672 2.174533 8.407282 5.828774 4.764783 5.524783 3.644908 15.515 7.022406 0.1715 1.168625 4.729125 3.232158 2.149 6.37575 12.0585 7.024658 1.355 5.591 3.088 0.396 25.004125 8.130375 0.2355 5.040375 7.95375 5.477375 18.4155 16.567625];
figure(‘Color’,’w’)
[hAx,hLine1,hLine2] = plotyy(x,y1,x,y2);
ylabel(hAx(1),’ACE (knot^2)’) % left y-axis
ylabel(hAx(2),’PDI (knot^3)’) % right y-axis
%grid on trendline, y double axis MATLAB Answers — New Questions