MATLAB Answers

Install new info.

31 views (last 30 days)
Your field team is going to collect additional data 5 days after the last day of previously recorded data. Prompt the user to enter the ice thickness data for this day, for all locations. Additionally, on this day a new location was found and recorded. Prompt the user to enter the new location ID and the ice data for the new location on this day. Update the Days vector with the new day, the LocationID string array with the new location, and the Ice matrix with the newly recorded data. Fill in the Ice matrix with the user-inputted ice data value for that location. Save the three updated variables as MA2_Task2.mat. On the command window, output the new location ID and the average ice thickness of the new day.
NOTE (avoid hardcoding)
How do I install new data to a workspace?


Rik on 14 Sep 2019
This is your homework assignment. What makes this a question for this forum?
Rik on 15 Sep 2019
Install new data? You mean load data from a mat file? If you enter load data matlab into your favorite internet search engine you will find the documentation of the load function that should do just that.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 15 Sep 2019
LocationID(6) = "some new string"
Days(17:21) = vector of 5 day numbers
Ice(17:21,6) = vector of 5 numeric values


Cody Abt
Cody Abt on 15 Sep 2019
I get LocationId(6) to work, but Days(17:21)=65 stacks like 5 65s at the bottom of my days on the code and same goes as ice when i enter 1.68 for it.
Walter Roberson
Walter Roberson on 15 Sep 2019
The right hand side of
is not a vector of 5 day numbers, it is a single day number.
You can keep track of where you are and enter one at a time:
for dayidx = 17:21
Days(dayidx) = scalar numeric value

Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!

Translated by