Undefined function or variable 'AppName'. ??? why ???

조회 수: 1 (최근 30일)
Mohammad Junayed
Mohammad Junayed 2018년 12월 12일
편집: madhan ravi 2018년 12월 12일
if Sign == 1
if appm==0
x{end+1,1}.AppName=aa1{selA,1}.Type;
status='[On]';
dataOn=i-7;
app=AppName;
appm=1;
end
SignStr = '[On]';
iCount = iCount + 1;
if ~isempty(r{selA,1})
r{selA,1} = r{selA,1} + 1;
else
r{selA,1} = 1;
end
else
if x{end}.AppName == aa1{selA,1}.Type
AppName=aa1{selA,1}.Type;
status='[Off]';
dataOff=i-7;
end

채택된 답변

madhan ravi
madhan ravi 2018년 12월 12일
편집: madhan ravi 2018년 12월 12일
It likely visible that you have a fieldname AppName from the if statement but then in the next step you assign AppName as if it is defined to app perhaps you are meant to assign with dot indexing like you did in if statement with struct x{...}.AppName
  댓글 수: 6
madhan ravi
madhan ravi 2018년 12월 12일
편집: madhan ravi 2018년 12월 12일
It's clearly a variable but you're treating it as a struct change your lines to below:
dataOn(end-1) and the next dataOn(end)
Mohammad Junayed
Mohammad Junayed 2018년 12월 12일
but ; Reference to non-existent field 'dataOn'.
Error in MainTest (line 767)
xx{end+1,1}.number=x{end}.dataOn-d{end-1}.dataOn;

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by