필터 지우기
필터 지우기

image array save it

조회 수: 2 (최근 30일)
Patrick Brown
Patrick Brown 2017년 3월 13일
답변: Walter Roberson 2017년 3월 13일
I have an image array fig and I want to save it but I get this error
fig =
1x2 Image array:
Image Image
>> saveas(fig,'a','pdf')
Error using saveas (line 58)
Invalid handle.
thanks!

답변 (1개)

Walter Roberson
Walter Roberson 2017년 3월 13일
You have two difficulties:
1) One of your images is already deleted. That can happen if you create images in a loop (or implicit loop) without "hold on" being on. For example,
for K = 1 : 3; fig(K) = imagesc(rand(40,80,3)); end
The imagesc() for K == 1 draws an image, but then when it is time to imagesc() for K == 2, because hold is not on, it does a cla, which deletes the image object created for K == 1.
This is your most immediate problem: you are working with the handle to something already deleted.
2) When you get that solved, you have the problem that saveas() only accepts scalars for its first argument. You cannot saveas() a pair of images. If the two have a common parent axes you can saveas() that common parent axes.

카테고리

Help CenterFile Exchange에서 Display Image에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by