Filter löschen
Filter löschen

I'm trying to plot matrix data from an Excel file, but the plot I obtained (named "2") doesn't match my expected result (named "1"); here's my code—can anyone assist?

22 Ansichten (letzte 30 Tage)
I am trying to plot my matrix data from an excel file. However, what I obtained is the same as what I desired. The expected plot is name 1, while what I have obtained is named 2. Here is my code:
% Load the matrix from the Excel sheet
matrix1 = readmatrix('Sample_Axes.xlsx', 'Sheet', 'one');
% Create a figure with subplots
figure;
% Plot matrix1 using contour
subplot(1, 3, 1);
contourf(matrix1, 20, 'LineColor', 'none'); % 20 contour levels, 'LineColor', 'none' for no contour lines
cb1 = colorbar;
colormap jet;
title('Matrix 1');
Can someone help me out?
  3 Kommentare
Oluwasogo
Oluwasogo am 24 Aug. 2024 um 12:50
Thank you, dpb. The data is actually from the image 1. I think I need to increase the contrast, which is what I am not getting.
dpb
dpb am 24 Aug. 2024 um 14:14
Some sort of transformation has been done on the image, then. Note the last figure I added to the above; if you invert the image up/down, then you can see that it does compare to the alternate image you posted. But, note also the scale of the colorbar() there is logarithmic but the image data of your array are both positive and negative so a simple log transform won't suffice as can't log() a negative value.
From whence then, did the other image come?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Orange finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by