Actual_Diagnosis_Matrix = [zeros(1,10),ones(1,10)];
number_correct= sum(Actual_Diagnosis_Matrix == Diagnosis_Matrix);
Final_percentage_correct=(number_correct/20)*100;
o/p:->
Matrix dimensions must agree.
Error in main (line 362)
number_correct= sum(Actual_Diagnosis_Matrix == Diagnosis_Matrix);
please help me with this problem as soon as possible

 Respuesta aceptada

Jan
Jan el 29 de Jun. de 2021

1 voto

The error message means, that Actual_Diagnosis_Matrix and Diagnosis_Matrix have different sizes. Then the == operator cannot compare them.
Check this using the debugger:
dbstop if error
Then run the code again. When Matlab stops at the error:
size(Actual_Diagnosis_Matrix)
size(Diagnosis_Matrix)

1 comentario

Rajib Panja
Rajib Panja el 30 de Jun. de 2021
thank you sir . Just for you , I point out my mistake and I fix it. There was a problem of matrix dimention. Actually Actual_Diagnosis_Matrix is a [1 20] matrix and Diagnosis_Matrix is [1 10] . that's why the error is happening . thank you so much sir. You are better than our college teachers.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Preguntada:

el 29 de Jun. de 2021

Comentada:

el 30 de Jun. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by