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!