why am i getting error with this code?

1 view (last 30 days)
Kregozt
Kregozt on 8 Feb 2023
Commented: Walter Roberson on 9 Feb 2023
testdata = readtable("testdata.xlsx");
predictions = char(trainedModel.predictFcn(testdata));
iscorrect=predictions==cell2mat(string((testdata.Character)));
iscorrect=iscorrect(:,2);
accuracy = sum(iscorrect)*100/30;
  9 Comments
Kregozt
Kregozt on 9 Feb 2023
but i have done the same but only converting the same to character
Walter Roberson
Walter Roberson on 9 Feb 2023
It would make it easier for us to advise you if you were to call
predictions = trainedModel.predictFcn(testdata);
whos predictions
and show us the output of the whos call.

Sign in to comment.

Answers (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 8 Feb 2023
Without looking at your data, it is diffiuclt to address your question properly. Thus, pl., post your sample data.

Community Treasure Hunt

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

Start Hunting!