Which block should be used for numel function in simulink?

조회 수: 3 (최근 30일)
Zexiong
Zexiong 2024년 1월 8일
답변: Fangjun Jiang 2024년 1월 8일
I want to express code accuracy = sum(predicted_labels == actual_labels)/numel(actual_labels) in simulink.
I choose "sum of Elements" for the function "sum(predicted_labels == actual_labels)".(I'm not sure. Is it correct?)
Which block should be used for numel function(numel(actual_labels) ) in simulink?

답변 (2개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2024년 1월 8일
I don't know if there is any Simulink block for numel() or size(), which are handled in Simulink automatically. In your execise you shall try to use [MATLAB function] and through which you can determine the accuracy of your classification model (one output with two inputs) as you defined: accuracy = sum(predicted_labels == actual_labels)/numel(actual_labels).

Fangjun Jiang
Fangjun Jiang 2024년 1월 8일

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by