Filter löschen
Filter löschen

Issue creating a heat map of 512x512 matrix.

4 Ansichten (letzte 30 Tage)
Noah Wilson
Noah Wilson am 3 Dez. 2020
Kommentiert: Noah Wilson am 3 Dez. 2020
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)

Akzeptierte Antwort

Cris LaPierre
Cris LaPierre am 3 Dez. 2020
Bearbeitet: Cris LaPierre am 3 Dez. 2020
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

Weitere Antworten (0)

Kategorien

Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by