MATLAB Answers

I have a matrix that is 17x6 and for one task i need to find • The location with the highest average ice thickness • The maximum overall ice thickness measurement with the associated location and day

2 views (last 30 days)
Alex Doan
Alex Doan on 6 Feb 2020
Answered: Jyothis Gireesh on 10 Feb 2020
I'm confused on how to do this. more so on how to get the index the day and location. But the location name is on a 1x6 and we have to index the name and also the Days is on a 17x1. use the data and scrool down to the bottom to get an idea of how it should look

  0 Comments

Sign in to comment.

Answers (1)

Jyothis Gireesh
Jyothis Gireesh on 10 Feb 2020
I am assuming here that the rows of the “Ice” matrix correspond to the “Days” and the columns correspond to the “LocationID” . You may use the following code to extract the required values.
clear;
load('MA2_data (2).mat');
[~, maxAvgIceLocation] = max(mean(Ice(:)));
maxIce = max(Ice(:));
[maxRow, maxCol] = find(ismember(Ice, maxIce));
maxDay = Days(maxRow);
maxLocation = LocationID(maxCol);
Here the variable “maxAvgIceLocation” correspond to the location of the highest average ice thickness. “maxIce”, “maxDay”and “maxLocation” gives the maximum overall ice thickness with the associated day and location respectively.

  0 Comments

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!