String을 변수 이름으로 변경 하기

53 ビュー (過去 30 日間)
Hyung-Seop Synn
Hyung-Seop Synn 2019 年 11 月 12 日
回答済み: Sourabh Kondapaka 2020 年 11 月 6 日
아래 문장에서 set 함수 실행시 "존재하지 않는 필드 'Inozx'에 대한 참조입니다"라는 ERR가 발생되는 바,
고견 부탁 드립니다
- 아 래 -
for cntdsply = 2:cntSecury
nwItmsNox = dBsecury{cntdsply,1};
Inox = num2str(nwItmsNox);
Inozx = strcat('Ino',Inox);
set(handles.Inozx,'String',nwItmsNox,'ForegroundColor','Blue');
end
<끝>

回答 (1 件)

Sourabh Kondapaka
Sourabh Kondapaka 2020 年 11 月 6 日
Hi,
You are accessing "Inozx" variable from the struct "handles" even though you have not assigned it to the struct.
I have commented the change below:
for cntdsply = 2:cntSecury
nwItmsNox = dBsecury{cntdsply,1};
Inox = num2str(nwItmsNox);
Inozx = strcat('Ino',Inox);
% Change "handles.Inozx" to "Inozx"
set(Inozx,'String',nwItmsNox,'ForegroundColor','Blue');
end

カテゴリ

Help Center および File Exchange구조체 についてさらに検索

Community Treasure Hunt

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

Start Hunting!