0
所以我試圖計算並作爲附加的圖片(http://i.stack.imgur.com/b2DHd.png)這裏描述顯示的平均數據是我:MATLAB - 顯示數據
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)
我的問題是,我是新來的MATLAB和我不知道如何正確編寫我的fprintf語句以便一次打印所有數據。請幫忙!