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 次查看(过去 30 天)
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.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fuzzy Logic in Simulink 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by