What does the "Reference to non-existent field" error message mean?

조회 수: 14 (최근 30일)
I am investigating why China has inflation, and we Indian students are trying to understand it. The China data we got, and inflation perform in China. So we can take precaution for our county in India too.
I am getting this error and I am not aware that why I am getting such an error. Can anyone guide me please ?
  댓글 수: 3

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

채택된 답변

Image Analyst
Image Analyst 2020년 7월 10일
Input.T_11 is defined in Main.m. Main.m calls Func_Task_11.m but does not pass Input to Func_Task_11() so when you get inside Func_Task_11, the Input variable is not in scope. Remember each function has it's own workspace separate from the others. If you want input in Func_Task_11(), you need to pass it in
In Main.m:
Func_Task_11(Input);
In Func_Task_11.m
function Func_Task_11(Input)
as the first line.
Also, do not use eps as a variable name - it's a built-in function.
  댓글 수: 1
vimal kumar chawda
vimal kumar chawda 2020년 7월 10일
In main file it was T_12.Input and I was doing the stuff again Input. T_11 so Input is was again called but it was just if you are already in structure then you cannot call the structure path from the beginning . Hence one can continur form it. Thanks but I have solved it by myself.
Thank you

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

추가 답변 (1개)

Robert
Robert 2020년 7월 10일
편집: Robert 2020년 7월 10일
The error message says that there is no field "T11" in (struct-) variable "Input". Set a breakpoint on the respective line and check.
It looks like you edited the script "Func_Task_11" after the error message was thrown, as line 29 in your screenshot is empty. If you didn't edit inbetween, "Func_Task_11.m" might be shadowed by another script of the same name on the matlab-path.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by