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