Binning returns zero values/column vector of 0's

2 ビュー (過去 30 日間)
Zhou Ci
Zhou Ci 2021 年 9 月 9 日
コメント済み: Image Analyst 2021 年 9 月 28 日
Hi all,
I have a table containing values from 3 parameters, T, V and P. My assignment says;
-For 1C interval you'll have several pixels fall in this interval.
-Calculate the median R for those pixels within this 1C.
-For this 1K interval, you would have several pixels.
I tried to do this but it returns a column vector of zero. Data is attached. Kindly suggest me how to accomplish it. Thank you.
temperature_rounded=round(Temp,0);
T=unique(temperature_rounded);
Z=NaN(size(T));
%%
for n=1:numel(T)
L= T==T(n); %select all positions where the rounded temperature is a specific value
Z(n)=median(Radius(L));%calculate the median for this selection
end
  1 件のコメント
Image Analyst
Image Analyst 2021 年 9 月 28 日
Code snippet is attached, but no data. Did you forget to attach it?
Isn't a 1 degree Kelvin interval the same as a 1 degree Celcius interval? So why wouldn't the "number of pixels" be the same for the two?
Have you learned of the functions histogram() and splitapply()?

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

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 9 月 9 日
編集済み: Walter Roberson 2021 年 9 月 9 日
L = temperature_rounded == T(n);

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by