필터 지우기
필터 지우기

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by