MATLAB Answers

THANH NGUYEN

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

Asked by THANH NGUYEN
on 5 Feb 2013

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

  0 Comments

Tags

Products

No products are associated with this question.

1 Answer

Answer by Image Analyst
on 5 Feb 2013
 Accepted answer
fprintf('The mean of ace = %f', mean(yourTable(:, 2)));

  8 Comments

THANH NGUYEN
on 6 Feb 2013

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 Simon
on 6 Feb 2013
fprintf('%d\n', sort(ace_data(:,3)))
THANH NGUYEN
on 6 Feb 2013

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.


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today