doubt with check boxes
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
hi i am deepthi....i am doing project in relevence feedback for cbir....i implemented the project... code is
function displayResults(filename, header)
figure('Position',[50 50 1300 690], 'MenuBar', 'none', 'Name', header, 'Resize', 'off', 'NumberTitle', 'off');
% Open 'filename' file... for reading... fid = fopen(filename);
i = 1; % Subplot index on the figure...
while 1 imagename = fgetl(fid); if ~ischar(imagename), break, end % Meaning: End of File...
[x, map] = imread(imagename);
subplot(2,5,i);
subimage(x, map);
i = i + 1;
end
fclose(fid);
result is it will display 10 images.... i dono how to display 1 checkbox(named relevant) under each image...plz help me i dono about position of checkbox to be display...i have to get feedback from the user and at the bottom in the middle i want to display 1 button(feedback)...plz help me....
0 Kommentare
Akzeptierte Antwort
ChristianW
am 5 Feb. 2013
uicontrol('Style','checkbox')
%
doc uicontrol
1 Kommentar
ChristianW
am 5 Feb. 2013
Bearbeitet: ChristianW
am 5 Feb. 2013
function checkbox_example()
close all; clc
M = zeros(5,2); % Matrix for checkbox values
for i = 1:10
subplot(2,5,i)
ax(i) = gca; %#ok<AGROW>
set(ax(i),'units','pixels')
pa = get(ax(i),'Position'); % Position of subplot axes
subimage(randi(3,6,4),jet(3));
set(ax(i),'XTickLabel',{},'YTickLabel',{},...
'XTick',[],'YTick',[],'TickLength',[0 0])
h(i) = uicontrol('Style','checkbox',...
'Position',[pa(1) pa(2)-5 pa(3) 20],...
'String',['Text' num2str(i)],...
'Callback', @box_value);
end
function box_value(hObj,event) %#ok<INUSD>
% Called when boxes are used
val = get(hObj,'Value');
M(h==hObj) = val;
disp(M')
end
end
Weitere Antworten (4)
Image Analyst
am 5 Feb. 2013
Why not just use GUIDE to make a bunch of axes controls, each with a checkbox control underneath it?
0 Kommentare
DEEPTHI
am 18 Feb. 2013
1 Kommentar
ChristianW
am 18 Feb. 2013
for j = 1:10, image_names{j} = sprintf('image %d',j); end %#ok<SAGROW>
selected = [3 7 1 10];
fid = fopen('relevant_images.txt', 'w');
fprintf(fid, '%s\n',image_names{selected});
fclose(fid);
Siehe auch
Kategorien
Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!