How to display a 256x256 image from .mat file?

6 views (last 30 days)
I have a 256x256 .mat file ''GrayScaleMRI.mat". I want to display it as an image but I am unble to do so. Here's what I tried to do. But it is showing error. Can anyone help me as to how I can do it?
a = load('GrayScaleMRI.mat');
imshow('GrayScaleMRI.mat');

Accepted Answer

DGM
DGM on 1 Dec 2021
Almost had it.
S = load('GrayScaleMRI.mat');
imshow(S.GrayScaleMRI)
When using the functional syntax for load(), the output argument is a struct containing the variables in the .mat file.

More Answers (0)

Categories

Find more on Structures in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!