MATLAB Answers

0

Install new info.

Asked by Nathan Formby on 14 Sep 2019
Latest activity Commented on by Walter Roberson
on 15 Sep 2019 at 23:46
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?

  3 Comments

Rik
on 14 Sep 2019
This is your homework assignment. What makes this a question for this forum?
Rik
on 15 Sep 2019 at 20:01
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.

Tags

1 Answer

Walter Roberson
Answer by Walter Roberson
on 15 Sep 2019 at 20:36
 Accepted Answer

LocationID(6) = "some new string"
Days(17:21) = vector of 5 day numbers
Ice(17:21,6) = vector of 5 numeric values

  2 Comments

Cody Abt on 15 Sep 2019 at 23:27
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
on 15 Sep 2019 at 23:46
The right hand side of
Days(17:21)=65
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
end

Sign in to comment.