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
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
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개)

카테고리

질문:

2016년 6월 27일

편집:

2016년 6월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by