MATLAB - Displaying Data
<p>So I am attempting to compute and display the average data as described in the attached picture (<a href="http://i.stack.imgur.com/b2DHd.png" rel="nofollow">http://i.stack.imgur.com/b2DHd.png</a>) Here is what I have: </p>

<pre><code>lakeData = load('C:\Users\Justin\Desktop\EGR2222\MATLAB\Data\LAKE_POWELL.txt');

year1= lakeData(:,1);
year2= lakeData (:,2);
year3= lakeData (:, 3);
year4= lakeData (:, 4);
year5= lakeData (:, 5);
year6= lakeData (:,6);
year7= lakeData (:,7);
year8= lakeData (:,8);

lakePowell = [year1, year2, year3, year4, year5, year6, year7, year8];
years = [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007];
average = mean(lakePowell)

fprintf('The average water level was %s in %s\n', average, years)
</code></pre>

<p>My issue is that I am new to MATLAB and am not sure how to properly code my fprintf statement in order for it to print all the data at once. Please help!</p>