Can't retrieve data from .mat file

2 vues (au cours des 30 derniers jours)
Craig Johnson
Craig Johnson le 31 Juil 2022
Commenté : Craig Johnson le 31 Juil 2022
Code:
input=load('MetData.mat')
output:
input =
struct with fields:
T: [5×10 double]
p: [5×10 double]
How can I extract the arrays and not just the dimensions of the arrays?
  1 commentaire
Craig Johnson
Craig Johnson le 31 Juil 2022
I also tried:
temperature=load(MetData.mat,T)
pressure=load(MetData.mat,p)

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 31 Juil 2022
temperature = input.t;
pressure = input.p;
Note that we recommend against using "input" as the name of a variable, as it gets confused with the input() function
  2 commentaires
Craig Johnson
Craig Johnson le 31 Juil 2022
I'm still getting the same output when using:
measurements=load('MetData.mat')
temperature = measurements.T;
pressure = measurements.p;
(also took your advice and renamed the variable)
Craig Johnson
Craig Johnson le 31 Juil 2022
i forgot about the semicolon suppression thanks so much

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Structures 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