Info

この質問は閉じられています。 編集または回答するには再度開いてください。

code is giving an empty matrix

1 回表示 (過去 30 日間)
Naema
Naema 2014 年 3 月 14 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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

回答 (2 件)

Naema
Naema 2014 年 3 月 14 日
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 2014 年 3 月 14 日
the data file that is needed to run the code is attached (jamal_240) which is named Eyspp in the code.

この質問は閉じられています。

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by