input window in matlab
古いコメントを表示
Hello everyone, i work with this code:
rep = uigetdir;
Imgs = dir(rep);
thisname = Imgs(3).name;
[path,name,ext]=fileparts(thisname);
ext=strcat('*',ext);
chemin = fullfile(rep,ext);
list = dir(chemin);
nbr_images= numel(list);
for n=1:25
k=dicomread(fullfile(rep, list(n).name));
end;
IM=double(k);
figure(1),,imshow(IM,[]);impixelinfo;
for n=1:25
figure(2),subplot(5,5,n),imshow(IM,[]);
end
IM=dicomread(fullfile(rep, list(1).name))
IM(1,1,numel(list))=0; %extend array to fit all slices
for n=2:numel(list)
IM(:,:,n)=dicomread(fullfile(rep, list(n).name));
end
xi= input('Give the centre X coord : '); % X coord
yi= input('Give the centre y coord : '); % y coord
for n=1:25
intensity=squeeze(IM(xi,yi,:));
figure(3),plot(intensity)
xlabel('Image')
ylabel('Intensité')
title('Courbe de progression du pixel courant')
grid('on');
set(gca,'Xtick',1:1:25);
set(gca,'Ytick',0:10:255);
end
i want to change this two instructions:
xi= input('Give the centre X coord : ');
yi= input('Give the centre y coord : ');
with an input window.
i tried to remplace them with this code :
prompt={'enter value for x','enter value for y'};
dig_title='Input';
num_lines=1;
def={' ',' '};
answer=inputdlg(prompt,dig_title,num_lines,def);
but it didn't work correctly.any help?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
