フィルターのクリア

Axes component name as an argument to a function

1 回表示 (過去 30 日間)
Jason
Jason 2015 年 10 月 15 日
コメント済み: Jason 2015 年 10 月 22 日
Is it possible to pass to a function the name of an axes component.
i.e.
function [high,low]=Autoscaleimage(handles,Image,n)
mn=mean(Image(:));
sd=std2(Image(:));
low=mn-sd;
high=mn+n*sd;
axes(handles.axes1)
imshow(img,[low,high]);
So sometimes I plot on axes2 and axes 3 etc, so can this be a function argument?

採用された回答

Rohit Kudva
Rohit Kudva 2015 年 10 月 21 日
Hi Jason,
You can pass the 'axes' object to a function and plot on that specific axes
function [high,low]=Autoscaleimage(ax,Image,n)
%ax is the handle to 'axes' object
mn=mean(Image(:));
sd=std2(Image(:));
low=mn-sd;
high=mn+n*sd;
axes(ax);
imshow(Image,[low,high]);
end
Regards,
Rohit

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Properties についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by