Using cellfun() to set cell array of graphic objects 'Visible' Property to 'off'
3 ビュー (過去 30 日間)
古いコメントを表示
I have a 1xn cell array of graphic objects-- currently I have the logic in a for-loop
for j = 1:numel(uis)
uis{j}.Visible = 'off';
end
I've always had trouble with the syntax for the cellfun function...I know this is wrong, but I'm trying to do something like:
cellfun(@set,uis,'Visible','off')
*note: found out here:
that for loops are faster than cellfun(), but I would like to know the answer to my question anyway :)
0 件のコメント
採用された回答
Stephen23
2019 年 2 月 12 日
編集済み: Stephen23
2019 年 2 月 12 日
cellfun(@(g)set(g,'Visible','off'),your_cell_array_of_handles)
Note that you could easily have put all of the handles into one handle array, in which case your code is much simpler and more efficient:
set(array_of_handles,'Visible','off')
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!