필터 지우기
필터 지우기

Why is my field non-existent?

조회 수: 3 (최근 30일)
Matt Brown
Matt Brown 2016년 4월 12일
댓글: Matt Brown 2016년 4월 12일
I have a piece of code that keeps returning a 'Reference to non-existant field...' error for a variable that is definitely defined and I am not sure why. Hopefully someone here can help.
The offending line of code reads:
u6=1/(2*results.mean.massflow.dp)*results.unc.dp;
And the error that gets returned reads: Reference to non-existent field 'dp'.
Ordinarily I would take this to mean that I hadn't defined this value or that there was a typo in the name. However the variable is definitely defined and no typos exist, as far as I can tell. This is easily verified by having the code print this value to the screen immediately before it is used:
results.mean.massflow.dp
u6=1/(2*results.mean.massflow.dp)*results.unc.dp;
This gives the following output on the screen:
ans = 6.095382113821141
Reference to non-existent field 'dp'.
Error in MH47MassFlow (line 108)
u6=1/(2*results.mean.massflow.dp)*results.unc.dp;

채택된 답변

Steven Lord
Steven Lord 2016년 4월 12일
What about results.unc.dp? I'm betting that doesn't exist.
  댓글 수: 1
Matt Brown
Matt Brown 2016년 4월 12일
Haha... now I feel dumb. That variable should have been results.unc.udp. Thanks!

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

추가 답변 (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