Can't retrieve data from .mat file

2 次查看(过去 30 天)
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 个评论
Craig Johnson
Craig Johnson 2022-7-31
I also tried:
temperature=load(MetData.mat,T)
pressure=load(MetData.mat,p)

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2022-7-31
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 个评论
Craig Johnson
Craig Johnson 2022-7-31
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 2022-7-31
i forgot about the semicolon suppression thanks so much

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by