Looking through a Matlab Class
2 ビュー (過去 30 日間)
古いコメントを表示
Hi!
I would like to execute some actions on every object of my class, say "Island".
Is there a command in Matlab allowing this? like
for island = Island
% actions to do
end
I hope I've made myself understood :)
Thank you!
Martin
0 件のコメント
採用された回答
Matt J
2013 年 5 月 27 日
if you have an array, obj, of Island objects, you would just do things like
for i=1:length(obj)
obj(i).prop=...
end
0 件のコメント
その他の回答 (1 件)
Martin
2013 年 5 月 27 日
編集済み: Matt J
2013 年 5 月 28 日
4 件のコメント
Daniel Shub
2013 年 5 月 28 日
@Martin, what you are asking to do seems a little bit strange (both the getting all objects and the getting the variable names). I think they are two separate questions and should be asked as such (you are likely to get better answers). In order to get the best answers, you will likely need to provide some broader insight into what you are trying to accomplish since my guess is you are too focused on the problem right now. Finally, please use the question, comment, and answer fields appropriately as it makes it easier to follow what is going on.
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!