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

 採用された回答

Jan
Jan 2021 年 6 月 29 日

1 投票

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 件のコメント

Rajib Panja
Rajib Panja 2021 年 6 月 30 日
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.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

質問済み:

2021 年 6 月 29 日

コメント済み:

2021 年 6 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by