필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Call several handles with the same name

조회 수: 1 (최근 30일)
Birch
Birch 2017년 9월 8일
마감: MATLAB Answer Bot 2021년 8월 20일
I need a bit of help. I have 40 handels called handles.rgb1-handles.rgb40. Is it possible to call all of them without calling them one at the time?
  댓글 수: 1
Stephen23
Stephen23 2017년 9월 8일
편집: Stephen23 2017년 9월 8일
Next time use a non-scalar structure rather then putting an index into the fieldnames. Then your code will be a lot simpler.

답변 (1개)

OCDER
OCDER 2017년 9월 8일
편집: OCDER 2017년 9월 8일
I think dynamic field names are what you want to use.
for j = 1:40
ThisHandle = handles.(['rgb' num2str(j)]); %Use dynamic field names
%Do something with ThisHandle
end

이 질문은 마감되었습니다.

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by