How do i store area into a list?

1 回表示 (過去 30 日間)
Shu Yi Ho
Shu Yi Ho 2019 年 7 月 5 日
コメント済み: Shu Yi Ho 2019 年 7 月 5 日
Here are my following questions:
1) How do i store area into a list then call for the max (function5)
2) How can i tidy up my code as i have some repeative
Currently I have issue with function 5. I want to store the area into a list. later part will call for the max area and compare with a value, if it exceed the range, alarm will be trigerred.
%% FUNCTION 5: AREA OF BLACK BLOBS (INDIVIDUAL)
if max(blobArea) > 3000
[a,fs]= audioread('Test/WarningAlarm.mp3');
sound(a(1:300000,1),fs);
numNGcases = numNGcases + 1;
fprintf('FUNCTION 5 Error\n');
else
numOKcases = numOKcases + 1;
end

採用された回答

Image Analyst
Image Analyst 2019 年 7 月 5 日
%% FUNCTION 5: AREA OF BLACK BLOBS (INDIVIDUAL)
allBlobAreas = [blobMeasurements.Area] % Put all blob areas into one list (vector).
if max(allBlobAreas) > 3000
etc.
  1 件のコメント
Shu Yi Ho
Shu Yi Ho 2019 年 7 月 5 日
Thank you

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by