How do I use an image as a global variable?

I need to pass my image from the GUI where I load it with this:
[path,user_cancel] = imgetfile();
if user_cancel
msgbox(sprintf('Trebuie sa selectati o imagine!'),'Error','Error');
return
end
img = imread(path);
axes(handles.axsImg_2);
imshow(img);
to another .m file where I apply some modifications to it. Using just the "global imgV" won't do it.

 採用された回答

Image Analyst
Image Analyst 2015 年 6 月 10 日

1 投票

No, but using
global img;
should do it.

その他の回答 (0 件)

質問済み:

2015 年 6 月 10 日

回答済み:

2015 年 6 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by