How to select and plot the maximum point in several pixels

1 回表示 (過去 30 日間)
Grace
Grace 2022 年 1 月 24 日
コメント済み: KSSV 2022 年 1 月 25 日
Hello,
I have a data set ( called TVL.Volume) from a spectrometer reading. The data is in the form of a matrix.There are 4096 pixels in the data set, while the rows and column are 104 and 60 respectively. Each pixel is a representation of a waveform. I want to select the maximum amplitude of the waveform of each pixel in all the rows and column, then plot the points as an image. Please find below my attempted code; the code does not work as expected. thank you for your anticipated response
%TVL.Volume is a matrix whose size is 4096 X 104 X 60
s= size(TVL.Volume);
for i = 1:s(2);
for j = 1:s(3);
a(i,j)=max(TVL.Volume(:,i,j));
end
end
imagesc(a)

回答 (1 件)

KSSV
KSSV 2022 年 1 月 24 日
A = rand(4096,104,60) ;
B = permute(A,[2 1 3]) ;
B_max = max(B,[],3) ;
imshow(B_max)
  2 件のコメント
Grace
Grace 2022 年 1 月 25 日
Thank you, KSSV
KSSV
KSSV 2022 年 1 月 25 日
Thanks is accepting/ voting the answer. :)

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by