Clear Filters
Clear Filters

How to solve "Input data must have as many columns as input variables and as many rows as independent sets of input values." error

1 view (last 30 days)
Hello! I created HTML-built UI and embedded it to matlab. I am able to pass the user-inputed data from the UI to matlab. My problem now is whenever I insert those data to my anfis model, it was generating this error
my riskFis is expected to receive 19 inputs and 5 inputs for typeFis, I already counted my inputs and they're of correct number. I tried changing my riskinputs to 19 constant number and the error is gone. But when i tried putting one input from the user-inputted data (the rest constant number), the error is back again. This is the code
% Data changed function: Assessment
function AssessmentDataChanged(app, event)
data = event.Data;
rfis = readfis('riskFis');
tfis = readfis('typeFis');
riskInput = [data.Age 38 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
riskOutput = evalfis(rfis, double(riskInput));
typeInput = [data.Age data.Temp data.Cough data.Hospital data.Ventilator];
typeOutput = evalfis(tfis, double(typeInput));
disp(riskOutput)
disp(typeOutput)
end
There is also no problem when i input user inputted data from the ui built with web app designer. So i think the problem is the data coming from the html built UI, but i dont know how to solve it.

Answers (0)

Categories

Find more on Fuzzy Logic in Simulink in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!