필터 지우기
필터 지우기

How to display a .mat file in an axes

조회 수: 3 (최근 30일)
Kaavya N
Kaavya N 2021년 6월 19일
댓글: Kaavya N 2021년 6월 20일
How to display a .mat file in a axes in GUI. I have a out.mat file obtained from another GUI operation . I want to open this file in a new GUI that has an axes field to it . When I click a pushbutton called image I must be able to show that out.mat on the axes field. Any help on how to do it.
  댓글 수: 2
Image Analyst
Image Analyst 2021년 6월 19일
A mat file contains variables. How those variables are "displayed" depends on what kind of variable is in the .mat file. For example with images you can use imshow() and for vectors you can use plot(). You forgot to attach your mat file, so there's not much we can do. I'll check back later for it.
Kaavya N
Kaavya N 2021년 6월 19일
I've linked the .mat file

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2021년 6월 19일
file_struct = load('out.mat');
embedded_image = file_struct.embedded_image;
imshow(handles.AXES_TO_DISPLAY_INTO, embedded_image);
Note: the out.mat file has a figure stored inside it, and that figure will become visible... probably confusing people. You can make it invisible by
file_struct.handles.figure1.Visible = 'off';
  댓글 수: 2
Image Analyst
Image Analyst 2021년 6월 20일
Correction:
embededimage = file_struct.embededimage;
Kaavya N
Kaavya N 2021년 6월 20일
Thanks for the help
how to select a .mat file by specifing its path and type and then display it on the axes. If the .mat file is user selected what must be the parameters inside imshow .
[filename, pathname] = uigetfile('*.mat', 'Pick an M-file');
if isequal(filename,0) || isequal(pathname,0)
disp('User pressed cancel');
end
axes(handles.axes5);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by