필터 지우기
필터 지우기

Error: unable to resolve the name

조회 수: 12 (최근 30일)
Emu
Emu 2024년 5월 21일
댓글: Emu 2024년 5월 21일
I have some code which generates a variable name iteratively in a loop, It was working fine but now I get the error: unable to resolve the name 'pre1min.windowchunkIdx'.
preORpost = {'pre' 'post'}
all_type_ALL = []; %output for all voc types for all ppts
%load raw data
for pOp = 1:length(preORpost)
for min = 1:2
%window = [preORpost{pOp} num2str(min) 'min'];
varName = [preORpost{pOp} num2str(min) 'min']; % Generate variable name
fieldName = 'windowchunkIdx'; % Generate field name
windowchunk = eval([varName '.' fieldName]);
  댓글 수: 1
Stephen23
Stephen23 2024년 5월 21일
편집: Stephen23 2024년 5월 21일
You did not tell us the most important information: how exactly did you get all of those variables into the workspace?

댓글을 달려면 로그인하십시오.

채택된 답변

Kunal Kandhari
Kunal Kandhari 2024년 5월 21일
The error, "Unable to resolve the name 'pre1min.windowchunkIdx'." suggests that the variable 'pre1min.windowchunkIdx' (or other similar variables) does not exist in the current workspace or does not have the expected structure. To address this, you need to ensure that these variables are loaded correctly and have the expected fields.
  댓글 수: 1
Emu
Emu 2024년 5월 21일
Ohhhh yes, i jsut reordered the script so this is below the loading, thank you :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by