Info

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

hi everyone! I need some help with a gui application...

조회 수: 1 (최근 30일)
lafe
lafe 2016년 7월 21일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a lot of radiobuttons that i want to enable and disable depending on the contex of a txt file. I want to use a general function for that.
I have a text which i load to my code like 2 independent arrays.
If the content of array Value(i,1) is 0, then disable the appropriate radio button (handlesChannels(i,1).
The second array contains the handlers.
For example,the form of the content of the first element is: handles.radiobutton1 etc.
my code is like that:
formatSpec = '%f%s%[^\n\r]';
% Allocate imported array to column variable names
Value = dataArray{:, 2};
handlesChannels = dataArray{:, 3};
for i=1:68
if Value(i,1)=1;
set(handlesChannels{i,1},'enable','on')
else
Value(i,1)=0;
set(handlesChannels{i,1},'enable','off')
end
end
the error i get is :
Error using set
Value must be a handle
Is it even possible to do something like that? Any ideas? Thanks a lot!
  댓글 수: 1
Geoff Hayes
Geoff Hayes 2016년 7월 21일
filo - what is the third column of dataArray as you seem to be assuming that these values are handles to the radio buttons? How and where is this variable being initialized? (Note that the error message is telling you that the third column is not composed of handles to graphics objects.)

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by