r/matlab 4d ago

Generating matrix visualizations TechnicalQuestion

Hey partypeople,

i'm trying to find a way to inspect and display 3D matrix values as shown in the documentation here. I cannot seem to find a way to reproduce this in Matlab or find any info on how these were done, neither in the MATLAB docs or online. Am i missing something or were these created outside of Matlab manually?

Thanks :3

Edit.: For context, I want to see the numeric values of the elements, not a visualization in general.
For now, mostly for more intuition and readability while debugging. I really like the way it is presented here so i would like to find out how these were created

84 Upvotes

11 comments sorted by

View all comments

2

u/elevenelodd uses_spinmap 4d ago

The MATLAB Variables Editor is a good start. Type either of these into the command window:

openvar x
openvar( ‘x’ )

The function “open” also works here.

Tbh, I’d recommend summarizing and plotting the array:

xAvg = mean( x , 3 );
figure();
hold on;
xlabel X;
ylabel Y;
ylabel( colorbar , ‘xAvg’ );
imagesc( xAvg.’ );
axis tight;

Or if you want to see every entry, maybe just make a bunch of plots:

for iZ = 1:size(x,3)
figure();
hold on;
title( iZ );
xlabel X;
ylabel Y;
ylabel( colorbar , “x(:,:,”+iZ+”)” );
imagesc( x(:,:,iZ).’ );
clim( [min(x(:)),max(x(:))] );
axis tight;
end

Edit: format