Beginner Check-box help
1 次查看(过去 30 天)
显示 更早的评论
Good morning everyone,
I am working on a GUI that displays data opened from a folder. All of the .txt files within that folder are imported and the data is extracted from it. That part I managed to complete, but I need now to extract specific parts of these .txt files and display them in a table w/ check boxes, i.e. Pixel Size. I used the 'strmatch' function (Matlab v. R2010b) to locate the line that starts with 'Pixel size', but when I check the box, it only displays the data from the first .txt file found. How can I get it to display all of the data? I also don't know how to program the unchecking part of the callback. I want the unselected data to disappear from the table.
for i = 1:l
PSize = strmatch('Pixel size',S{i}{1});
i=i+1;
end
if(get(hObject,'Value') == get(hObject,'Max'))
for i = 1:l
set(uitable1,'Data',{S{i}{1}{PSize(1)}});
i=i+1;
end
else
%Unchecking the checkbox clears the Pixel Size data
end
Thank you in advance
0 个评论
回答(1 个)
Jan
2013-6-24
编辑:Jan
2013-6-24
You cannot modify the loop counter of FOR loops in Matlab:
for i = 1:5
disp(i)
i = i + 1;
end
This shows the number from 1 to 5, and the increasing of i insider the loop has no effect. I do not know if this addresses your problem, but it is at least another problem.
What is the value of "l"?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!