フィルターのクリア

Issue creating a heat map of 512x512 matrix.

4 ビュー (過去 30 日間)
Noah Wilson
Noah Wilson 2020 年 12 月 3 日
コメント済み: Noah Wilson 2020 年 12 月 3 日
I am trying to create a 'image' using a heatmap for this data from a CCD camera in the lab. Each data point is the value from one pixel so I am trying to get matlab to plot that as a heatmap or something similar and cannot figure out how to do so. I appreciate any help you can give me. I attached my current code and the sample data I am working with.
%Input the folder location containing data that is being analyzed
MainFolder = 'C:\Users\nefwa\Downloads\Test';
cd(MainFolder)
rawdatafile = dir('*.csv');
rawdata = rawdatafile.name;
RawDataMatrix = csvread(rawdata, 32, 0);
RawDataMatrix(:,514) = [];
RawDataMatrix(:,1) = [];
xvar = [1:512];
yvar = [1:512];
heatmap(RawDataMatrix, xvar)

採用された回答

Cris LaPierre
Cris LaPierre 2020 年 12 月 3 日
編集済み: Cris LaPierre 2020 年 12 月 3 日
I suggest using readmatrix instead of csvread.
With a 512x512 matrix, I would suggest imagesc instead of heatmap. Rows correspond to Y, and columns correspond to X. I use colormap jet because it uses a broader range of colors, making differences easier to see.
RawDataMatrix = readmatrix("WaterVapor_660_Dec 2 2020_372.csv","NumHeaderLines", 32);
RawDataMatrix(:,1) = [];
imagesc(RawDataMatrix)
colormap jet
colorbar
However, should you prefer heatmap, try the following.
heatmap(RawDataMatrix,'GridVisible','off');
colormap jet
  1 件のコメント
Noah Wilson
Noah Wilson 2020 年 12 月 3 日
Works like a charm. Thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by