Already have x,y-data as vectors but can't extract z-data to an array from sfit object.

2 views (last 30 days)
Hello, I am doing a small project that related to simulate a PV panel connect to a load. I'm currently following the instruction from this link: http://www.mathworks.com/webex/recordings/Solar_111809/ . But after creating a sfit object (with 3 parameters: Irradiance, Voltage and Current) by Surface Fitting Toolbox, I can't substitute the Voltage vector (1x218) and Irradiance vector (17x1) on to that sfit object to retrieve Current array data (17x218) like in the intruction video (from 21:57 to 23:15). It always report an error like this:
"Error using sfit/subsref (line 16)
Error while trying to evaluate SFIT model.
Caused by:
Error using fittype/evaluate (line 85)
Error while trying to evaluate FITTYPE function obj:
XI and YI must be the same size or vectors of different orientations."
I really dont know what is wrong with my code, here it is after creating the .m file from the sfit object:
%a:voltage; i:Irradiance; y:Current%
[PV_VISurface, gof] = mycreateFit(a,i,y);
>> Irradiance = (min(i):50:max(i))';
>> ArrayVoltage = 0:0.1:ceil(10*max(a))/10;
>> ArrayCurrent = PV_VISurface(ArrayVoltage,Irradiance);

Answers (0)

Community Treasure Hunt

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

Start Hunting!