
Technical discussion about Matlab and issues related to Digital Signal Processing.
Hi people,
I am trying to plot the following equation in matlab. I dont expect
the plot to be a straight line since the equation is not a straight
line equation. I am on a timeline of 25 hours so please help.
y=1+cos(2*a)/1+1cos(2(a-i))
where;
a ranges from angles 0 to 180
i is a constant angle whenever y is calculated input at the
matlab console ranging from 0 to 180.
here is my code;
i=input('The angle i:');
a=0:180;
num=1+cosd(2*a);
dem=1+cosd(2*(i-a));
y=num/dem;
plot(a,y)
please help
Why r u using Cosd instead of cos !! i thought from the equation that u want
to use cosine !!!
if cosine is what u r looking for ... Try this out !!
i=input('The angle i:');
a=0:1:180;
num=1+cos(2*a);
dem=1+cos(2*(i-a));
y=num./dem;
plot(a,y);
Jamil
On Thu, Aug 21, 2008 at 3:02 PM, pnalelia <p...@yahoo.com> wrote:
> Hi people,
> I am trying to plot the following equation in matlab. I dont expect
> the plot to be a straight line since the equation is not a straight
> line equation. I am on a timeline of 25 hours so please help.
>
> y=1+cos(2*a)/1+1cos(2(a-i))
>
> where;
> a ranges from angles 0 to 180
> i is a constant angle whenever y is calculated input at the
> matlab console ranging from 0 to 180.
>
> here is my code;
>
> i=input('The angle i:');
> a=0:180;
>
> num=1+cosd(2*a);
> dem=1+cosd(2*(i-a));
> y=num/dem;
> plot(a,y)
>
> please help
>
>
>
--
**********************************************
Jamil Abou Saleh
Masters of Applied Sciences
Electrical and Computer Engineering
University of Waterloo
Mailing Address:
196 WestMount Road North, Apt# 413
Waterloo, Ontario, Canada
N2L3G5
Home# +1 (519) 7728701
**********************************************
i think because he wants to work in degrees, instead of radians (as he wrote
0 to 180, instead of 0 to pi).
On Fri, Aug 22, 2008 at 9:05 AM, Jamil Abou Saleh <j...@gmail.com
> wrote:
> Why r u using Cosd instead of cos !! i thought from the equation that u
> want to use cosine !!!
> if cosine is what u r looking for ... Try this out !!
>
> i=input('The angle i:');
> a=0:1:180;
> num=1+cos(2*a);
> dem=1+cos(2*(i-a));
> y=num./dem;
> plot(a,y);
> Jamil
>
> On Thu, Aug 21, 2008 at 3:02 PM, pnalelia <p...@yahoo.com> wrote:
>
>> Hi people,
>> I am trying to plot the following equation in matlab. I dont expect
>> the plot to be a straight line since the equation is not a straight
>> line equation. I am on a timeline of 25 hours so please help.
>>
>> y=1+cos(2*a)/1+1cos(2(a-i))
>>
>> where;
>> a ranges from angles 0 to 180
>> i is a constant angle whenever y is calculated input at the
>> matlab console ranging from 0 to 180.
>>
>> here is my code;
>>
>> i=input('The angle i:');
>> a=0:180;
>>
>> num=1+cosd(2*a);
>> dem=1+cosd(2*(i-a));
>> y=num/dem;
>> plot(a,y)
>>
>> please help