How can I display an image from my code right in the application window and not in a separate one?

1 visualizzazione (ultimi 30 giorni)
Hello,
I am working on an application in Matlab App Designer and I would like to display an image right in the application window and not in a separate one. The "load data" button loads and process the data and also display the image using an imagesc function.
Thanks for your answer.
clearvars -except S FAZA
S = load('Rec-kar_halogen_2_5a9_0_0083HzLockin_snimk_5Hz');
TV = S.Frame1_DateTime;
START = 2;
HH = num2str(TV(4));
mm = num2str(TV(5));
ss = num2str(TV(6));
SS = strrep(num2str(TV(7)), '.', '');
if length(SS) == 5
SS = ['0' SS];
end
DateString = [HH ':' mm ':' ss '.' SS];
start_time = datetime(DateString, 'Format', 'HH:mm:ss.SSSSSS');
f_lockin = 0.0083;
perioda = 5;
limit = perioda*500;
for l = 1:1
matica = zeros(110,110,l*limit);
t = [];
for i = START:l*limit
x = S.(['Frame', num2str(i)]);
x = x(28:137,109:218);
matica(:,:,i) = x;
TV = S.(['Frame', num2str(i) '_DateTime']);
HH = num2str(TV(4));
mm = num2str(TV(5));
ss = num2str(TV(6));
SS = strrep(num2str(TV(7)), '.', '');
if length(SS) == 5
SS = ['0' SS];
end
DateString = [HH ':' mm ':' ss '.' SS];
next_time = datetime(DateString, 'Format', 'HH:mm:ss.SSSSSS');
t(i) = seconds(next_time - start_time);
end
if START == 3
matica = matica(:,:,START:end);
t = t(1,START:end);
elseif START == 2
matica = matica(:,:,START:end);
t = t(1,START:end);
end
X = size(matica,1);
Y = size(matica,2);
COS = cos(2*pi*f_lockin.*t)';
SIN = sin(2*pi*f_lockin.*t)';
faza = zeros(X,Y);
for i = 1:X
for ii= 1:Y
a = abs(squeeze(matica(i,ii,1:length(t))).*COS);
b = abs(squeeze(matica(i,ii,1:length(t))).*SIN);
faza(i,ii) = atan(sum(b)/sum(a));
end
end
FAZA(:,:,perioda) = faza;
imagesc(faza);
imagesc(faza1)
faza = gray;
faza = flipud (faza);
colormap (faza);
end

Risposte (1)

Image Analyst
Image Analyst il 23 Mar 2023
See attached demo.

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by