Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Why this Matlab code is incorrect

Status
Not open for further replies.

sadra

Newbie
Newbie level 3
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:

Capture.JPG
Errors when run this code
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top