How to solve this error? Invalid types for comparison.

5 Ansichten (letzte 30 Tage)
I want to calculate accuracy, sensitivity,...,etc based on actual and predicted data, this code is working well for numbered labels but it gives this error for string labels.

Akzeptierte Antwort

Geoff Hayes
Geoff Hayes am 30 Dez. 2022
@Bajdar Nouredine - for string labels, I suspect that you need to use strcmp rather than == for checking to see if two strings are identical (if that is what you mean). You would probably want to check the type (i.e. use isstring) first (of the ACTUAL and PREDICTED arrays) to determine whether you need to use strcmp or ==.
  5 Kommentare

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)


Find more on Tables 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!

Translated by