Jul 10, 2011 #1 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 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: Jul 10, 2011
Hey Can you help me plz to plot the output of this equation using Matlab 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
Jul 10, 2011 #2 _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,909 This is a real function. Only three terms: m= -1,0,1 ==> Σ(...) = 1 + 2*cos(pi*cos(θ))
Jul 10, 2011 #3 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 ?
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 ?
Jul 10, 2011 #4 _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,909 Mohammed EL_Kenawy said: thank you Eduardo but how about theta . I want it in degrees 0 20 40 60 .... 180 on xlabel but i have an error Click to expand... 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 said: thank you Eduardo but how about theta . I want it in degrees 0 20 40 60 .... 180 on xlabel but i have an error Click to expand... 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')
Jul 11, 2011 #5 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) 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
Thank you very much Eduardo for this equation i want to plot E(indB) versus theta (in degrees) 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
Jul 11, 2011 #6 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
Jul 11, 2011 #7 _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,909 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')
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')
Jul 11, 2011 #8 F flanello Advanced Member level 1 Joined Jan 9, 2008 Messages 433 Helped 91 Reputation 182 Reaction score 82 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.
Jul 11, 2011 #9 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 I am very happy for your reply