I have two 200 x 200 arrays of pixel values.
They are all negative values representing -dB values
All of the signal pixel values are >= -20.
All other pixel values (no signal) have been forced to -60.
I want to add both arrays so that only the signal pixels are added to have a summated signal intensity.
This relates to TFM imaging in Ultrasonics.

댓글 수: 2

Convert your -60 values into NaNs :
noSignal = find(A == -60);
A(noSignal = NaN);
Then do your addition
Alan Keenan
Alan Keenan 2020년 8월 25일
Thanks for your answer, however, there appears to be a problem with the syntax of A(noSignal = NaN);
I entered
noSignal = find(img_dbLL == -60);
img_dbLL(noSignal = NaN);
When trying to run, I get the following message:
Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use
'=='.

댓글을 달려면 로그인하십시오.

 채택된 답변

Matt J
Matt J 2020년 8월 25일
편집: Matt J 2020년 8월 25일

0 개 추천

I'll call your two arrays A and B.
map=A<-20 | B<-20;
result=A+B;
result(map)=-60;

댓글 수: 3

Alan Keenan
Alan Keenan 2020년 8월 25일
Thanks, this works, however, I had to do result=A-B as adding the 2 negative numbers gave a smaller summed signal intensity.
Matt J
Matt J 2020년 8월 25일
You're welcome, but please Accept-click the asnwer if your issue is resolved.
Alan Keenan
Alan Keenan 2020년 8월 25일
Done, cheers.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

제품

릴리스

R2019b

질문:

2020년 8월 25일

댓글:

2020년 8월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by