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.

help in exp function in matlab

Status
Not open for further replies.

Mohammed EL_Kenawy

Newbie level 5
Joined
May 1, 2011
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Egypt
Activity points
1,333
Hey

Can you help me plz to plot the output of this equation using Matlab

75_1310253225.png


the vertical axes is ...... Magnitude of the output in dB
the Horizontal axes is the angle in degrees

could I have the code of this

I really need it

help me
 
Last edited:

_Eduardo_

Full Member level 5
Joined
Aug 31, 2009
Messages
295
Helped
118
Reputation
238
Reaction score
103
Trophy points
1,323
Location
Argentina
Activity points
2,853
75_1310253225.png


This is a real function.

Only three terms: m= -1,0,1 ==> Σ(...) = 1 + 2*cos(pi*cos(θ))
 

Mohammed EL_Kenawy

Newbie level 5
Joined
May 1, 2011
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Egypt
Activity points
1,333
thank you Eduardo but how about theta .
I want it in degrees 0 20 40 60 .... 180 on xlabel but i have an error
I can't fix the dimensions of length
can u help me ?
 

_Eduardo_

Full Member level 5
Joined
Aug 31, 2009
Messages
295
Helped
118
Reputation
238
Reaction score
103
Trophy points
1,323
Location
Argentina
Activity points
2,853
thank you Eduardo but how about theta .
I want it in degrees 0 20 40 60 .... 180 on xlabel but i have an error

Something like this ?

Code:
t = 0:.5:180 ;                  % 0.5° step
y = 1+2*cos(pi*cos(t*pi/180));  % pi/180 adjust argument to radians
plot(t,20*log10(abs(y)))        % 20*log10(abs(...  convert to decibels
xlabel('Degrees')               % axis labels
ylabel('dB')
 

Mohammed EL_Kenawy

Newbie level 5
Joined
May 1, 2011
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Egypt
Activity points
1,333
Thank you very much Eduardo

for this equation i want to plot E(indB) versus theta (in degrees)
61_1310346184.jpg


say W =[ 0 0.2857 0.5714 0.8571 0.8571 0.5714 0.2857 0]

I want the code to see if it give the figure

plz I need the code my friend
 

Mohammed EL_Kenawy

Newbie level 5
Joined
May 1, 2011
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Egypt
Activity points
1,333
please help me,
I have an error with undefined function w
I used for loop but can't run
help me
 

_Eduardo_

Full Member level 5
Joined
Aug 31, 2009
Messages
295
Helped
118
Reputation
238
Reaction score
103
Trophy points
1,323
Location
Argentina
Activity points
2,853
It's the same, just take care with the matrix multiplication.

Code:
beta = 1 ; d = 1 ;   % Dummy values

W =[ 0 0.2857 0.5714 0.8571 0.8571 0.5714 0.2857 0] ;
m = 1:8 ;
angle = 0:.5:180 ;   % 0.5° step
z = exp(i*beta*d*m'*cos(angle*pi/180)) ;

plot(angle,20*log10(abs(W*z)))
xlabel('Degrees')
ylabel('dB')
 

flanello

Advanced Member level 1
Joined
Jan 9, 2008
Messages
435
Helped
91
Reputation
182
Reaction score
81
Trophy points
1,308
Activity points
3,491
@Mohammed EL_Kenawy: Perhaps you could post your matlab code so that someone can give some hints.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top