Saveas Invalid Handle Error

15 ビュー (過去 30 日間)
Kavya Sudhir
Kavya Sudhir 2020 年 6 月 30 日
コメント済み: Kavya Sudhir 2020 年 6 月 30 日
Hi! I am just trying to run a basic program where I save the new figure I have created using the edge() function; however, I keep running into this error: "Error using saves; invalid handle". I tried to troubleshoot the invalid handle by adding gcf but still am getting the same error. Any ideas?
>> Img=imread('biofilm ri4 (1).tiff');
figure
imshow(I)
fig=edge(I,'Prewitt');
gcf=fig;
saveas(gcf,'Barchart.png')
Error using saveas (line 60)
Invalid handle.

採用された回答

Walter Roberson
Walter Roberson 2020 年 6 月 30 日
edge() does not return a figure or any other type of graphic object. edge() returns a logical() array, and does not display the array. The array is not anywhere on the display to be captured by saveas() or other screen capture calls.
You should be just using imwrite() to write the array returned by edge() into a file.
  1 件のコメント
Kavya Sudhir
Kavya Sudhir 2020 年 6 月 30 日
Thank you!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by