Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Reference to non-existent field 'recording'.

1 visualización (últimos 30 días)
Paola Quintana
Paola Quintana el 25 de Nov. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
This is my code
question_6 = load('recording.mat');
time = question_6.recording.X.Data
and this is what my command window looks like when i run it:
Reference to non-existent field 'recording'.
Error in lab_9_script (line 11)
time = question_6.recording.X.Data
I made sure my .mat that i am calling is named like that and they are all in the same folder yet for some reason it says it does not exist?
  5 comentarios
Image Analyst
Image Analyst el 25 de Nov. de 2020
Editada: Image Analyst el 25 de Nov. de 2020
Try again. If you get to the time line, it will have to get past the load() line, and if you leave off the semicolon it must show something in the command line.
Paola Quintana
Paola Quintana el 25 de Nov. de 2020
it was saving as something else. I renamed it but in the workspace it was called diffrently. Thank you!

Respuestas (1)

per isakson
per isakson el 25 de Nov. de 2020
Editada: per isakson el 25 de Nov. de 2020
%%
clearvars
a=1; b=2; X.data = 17;
save( 'recording.mat' );
%%
question_6 = load('recording.mat')
outputs
question_6 =
struct with fields:
X: [1×1 struct]
a: 1
b: 2
>>
Conclusion. There is no field named recording
Try
time = question_6.X.Data
ans =
17
>>

Community Treasure Hunt

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

Start Hunting!

Translated by