Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

code is giving an empty matrix

1 Ansicht (letzte 30 Tage)
Naema
Naema am 14 Mär. 2014
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hi: I am having an empty figure as the result, can anyone see what is the problem?. thanks,
here is the code//////////////// clear all; close all; clc; x=-120:1:120-1; y=-120:1:120-1; [X,Y]=meshgrid(x,y); rf=(2250/2); aaa = (-120:1:120); bbb = (-120:1:120); % for xx=linspace(-120,120,240); a=1; for xx=-120:1:120; b=1; for yy=-120:1:120;
% for yy=linspace(-120,120,240); C=zeros(length(X),length(Y)); Eyspp=dlmread('jamal_6_2.txt');
Eyfib=exp((-(X-xx).^2-(Y-yy).^2)/rf^2); % fib=Eyfib(b:b+xx-1,a:a+yy-1); fn_int=Eyfib.*conj(Eyfib); % Norma = sum(sum(Eyspp.*conj(Eyspp)))*sum(sum(Eyspp.*conj(Eyspp))); % C(a,b)=sum(sum(fn_int)./sqrt(Norma)); C(a,b)=sum(sum(fn_int)); b=b+1; end a=a+1; end figure(1); imagesc(aaa,bbb,abs(C));title('overalp');xlabel('um') axis square; grid on;
# Item one # Item two

Antworten (2)

Naema
Naema am 14 Mär. 2014
the code is organized here, is there anyone who could help me figure out what is wrong with the code? thanks, Naema
clear all;
close all;
clc;
x=-120:1:120-1;
y=-120:1:120-1;
[X,Y]=meshgrid(x,y);
rf=(2250/2);
aaa = (-120:1:120);
bbb = (-120:1:120);
% for xx=linspace(-120,120,240);
a=1;
for xx=-120:1:120;
b=1;
for yy=-120:1:120;
% for yy=linspace(-120,120,240);
C=zeros(length(X),length(Y));
Eyspp=dlmread('jamal_6_2.txt');
Eyfib=exp((-(X-xx).^2-(Y-yy).^2)/rf^2);
% fib=Eyfib(b:b+xx-1,a:a+yy-1);
fn_int=Eyfib.*conj(Eyfib);
% Norma = sum(sum(Eyspp.*conj(Eyspp)))*sum(sum(Eyspp.*conj(Eyspp)));
% C(a,b)=sum(sum(fn_int)./sqrt(Norma));
C(a,b)=sum(sum(fn_int));
b=b+1;
end
a=a+1;
end
figure(1);
imagesc(aaa,bbb,abs(C));title('overalp');xlabel('um')
axis square; grid on;

Naema
Naema am 14 Mär. 2014
the data file that is needed to run the code is attached (jamal_240) which is named Eyspp in the code.

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by