help to find and display the mean,median for a matrix

The table is # # # # # The first is year.then ace,...... How to find and display the mean of second column and the rest of it. For example, the mean of ace is I used disp(['the mean of ace is ',num2str

 Réponse acceptée

fprintf('The mean of ace = %f', mean(yourTable(:, 2)));

8 commentaires

Image, I got the right answer but there's EDU>>behind the answer. It suppose not to appear
As I understand it you can't get rid of the EDU because it's a student edition. You can add a line feed (\n) though:
fprintf('The mean of ace = %f\n', mean(yourTable(:, 2)));
the assignment is here: http://www.mediafire.com/view/?vxusaduasijdpdp how can I make the table at the end also,and how to make the space between those max, median, and mean. Thanks first.
fprintf('\n\nThe mean of ace = %f\n', 600);
disp(' ')
disp('next line here')
The mean of ace = 600.000000
next line here
there is a space between the quotes in disp(' ')
fprintf(' Atlanta Basin Hurricane Seasons 1950-2010\n');
fprintf(' Year ACE Index # Tropical # Hurricanes # Hurricanes\n');
fprintf(' Storms Cat. 1-5 Cat. 3-5 \n');
for k = 1:number of rows
fprintf('%d %d %d %d %d', sorted1(k), sorted2(k), sorted3(k),...
sorted4(k), sorted5(k));
end
Of course, the sortedN arrays are what you were supposed to get from sorting in the prior part of your homework - a part you will have to do by yourself.
I really don't know how to do it. I says sort the table by ACE (descending) fprintf('%d %d %d %d', sort(ace_data(:,3))); it display all the number in one row only.
Jan
Jan le 6 Fév 2013
Modifié(e) : Jan le 6 Fév 2013
fprintf('%d\n', sort(ace_data(:,3)))
ace_data =[years,ace,tropical_storm,hurricanes,major_hurricanes]; x=max(ace_data(:,2)); disp(sortrows(ace_data,-2))
not running, error line 41. I don't know what 's wrong.

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by