Undefined function or variable error
이전 댓글 표시
vg=xlsread('CV_data.xlsx','F3:F103'); %Reading data from excel file.
capac=xlsread('CV_data.xlsx','H3:H103'); %Reading data from excel file.
cpad=interp1(vg,capac,vgate0,'pchip'); %Interpolating for vg=vgate0 to get cpad.
cgate=(cpad*cq)/(cpad+cq); %cq I have calculated before.
When I try to calculate cgate it gives an error :
Undefined function or variable 'cpad'.
댓글 수: 2
KSSV
2016년 6월 27일
cpas is not defined..It could be empty matrix. Try checking what is cpad. Try to check vg,cpac which you are reading from xlsx files. Tehy are empty I guess.
Walter Roberson
2016년 6월 27일
Empty arrays would still exist and you would not get an error about undefined function or variable.
But there is no definition for vgate0 given, so the assignment to cpad could be failing; if so then you would get an error message for that before you got an error message in the cgate line.
cq is not defined in the code either.
Question: is vgate0 a scalar? If it is not a scalar then you probably want ./ instead of / when you calculate cgate
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!