Why this Matlab code is incorrect

Status
Not open for further replies.

sadra

Newbie
Joined
Feb 26, 2018
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
23
Why this code is incorrect?

Code:
% circular array
% Draw AF
% characteristics:   1) array radius= a    2)number of elements=N
%                    3)weight of each element=Wn    4)phase angle of each  element=phi_n
%            5)phase of each element=delta_n

%             **********************************


clc
clear all
close all
N=input('Number of elements in array:');
% dl=input('space between elements :');
a=input('Enter array radius respect to lamba:');


%n=mod(N,2);
theta=0:pi/32:pi ;
phi=0:pi/32:2*pi ;
AF=0 ; %initiate
% i= 0+1i
%if n==0 % number of elements are even

       for j=1:N
            
        w(j)=input('Enter weight element :  ' ) ; 
        delta(j)=input('Enter phase element :  ' ) ; 
        phin(j)=2*pi*(j-1)/N;

        AF=(w(j).*exp(-i*(-2*pi*a.*sin(theta).*cos(phi)+delta(j)))+AF);
       end

       

plot3(AF,theta,phi)
 
Last edited by a moderator:


Errors when run this code
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…