Install new info.

6 vues (au cours des 30 derniers jours)
Nathan Formby
Nathan Formby le 14 Sep 2019
Commenté : Walter Roberson le 15 Sep 2019
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 commentaires
Rik
Rik le 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.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 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
  2 commentaires
Cody Abt
Cody Abt le 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 le 15 Sep 2019
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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by