How to resolve the error using evalfis: 'Input data must have as many columns as input variables'
Show older comments
Error using evalfis (line 62)
The first argument should have as many columns as input variables and
as many rows as independent sets of input values.
Error in ODentropy>push_trainimg_Callback (line 698)
Outfis=evalfis(pixarry,fuz);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in ODentropy (line 43)
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)ODentropy('push_trainimg_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
1 Comment
Walter Roberson
on 26 Sep 2016
What is size(pixarry) and class(pixarry) ? How many input variables was your fis built for?
Answers (1)
If the number of columns in the input data (N) differs from the number of input variables in the fuzzy system (NfisIn), such error message will be generated.
%% load a fuzzy system
fis = readfis("tipper");
%% input values
Service = (0:10)';
Food = (0:10)';
input1 = [Service]; % one input array
input2 = [Service, Food]; % two-input array
[M, N] = size(input1)
NfisIn = numel(fis.input)
%% Test 1: output of the Fuzzy Tipper
Tip = evalfis(fis, input2)
%% Test 2: output of the Fuzzy Tipper
Tip = evalfis(fis, input1)
Categories
Find more on Deployment in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!