Jun 24, 2011 #1 vipinlal Full Member level 6 Joined Mar 8, 2010 Messages 357 Helped 76 Reputation 152 Reaction score 60 Trophy points 1,308 Location India Activity points 3,191 Code: realW = 2.0*cos(2.0*pi*20/2001); imagW = sin(2.0*pi*20/2001); y = 0; d1 = 0.0; d2 = 0.0; N=2001; for n= 1:N { y = x(n) + realW*d1 - d2; d2 = d1; d1 = y; } end resultr = 0.5*realW*d1 - d2; resulti = imagW*d1; I am getting the following error on the below code,please help.. ??? y = x + realW*d1 - d2; | Error: The expression to the left of the equals sign is not a valid target for an assignment.
Code: realW = 2.0*cos(2.0*pi*20/2001); imagW = sin(2.0*pi*20/2001); y = 0; d1 = 0.0; d2 = 0.0; N=2001; for n= 1:N { y = x(n) + realW*d1 - d2; d2 = d1; d1 = y; } end resultr = 0.5*realW*d1 - d2; resulti = imagW*d1; I am getting the following error on the below code,please help.. ??? y = x + realW*d1 - d2; | Error: The expression to the left of the equals sign is not a valid target for an assignment.
Jun 24, 2011 #2 trav1s Full Member level 1 Joined Nov 11, 2010 Messages 98 Helped 29 Reputation 60 Reaction score 28 Trophy points 1,318 Location Japan Activity points 2,025 Please define x.
Jun 24, 2011 #3 L lifelong1985 Newbie level 1 Joined Jun 24, 2011 Messages 1 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,283 vipinlal said: Code: realW = 2.0*cos(2.0*pi*20/2001); imagW = sin(2.0*pi*20/2001); y = 0; d1 = 0.0; d2 = 0.0; N=2001; for n= 1:N { y = x(n) + realW*d1 - d2; d2 = d1; d1 = y; } end resultr = 0.5*realW*d1 - d2; resulti = imagW*d1; I am getting the following error on the below code,please help.. ??? y = x + realW*d1 - d2; | Error: The expression to the left of the equals sign is not a valid target for an assignment. Click to expand... you did not define what is x in the program
vipinlal said: Code: realW = 2.0*cos(2.0*pi*20/2001); imagW = sin(2.0*pi*20/2001); y = 0; d1 = 0.0; d2 = 0.0; N=2001; for n= 1:N { y = x(n) + realW*d1 - d2; d2 = d1; d1 = y; } end resultr = 0.5*realW*d1 - d2; resulti = imagW*d1; I am getting the following error on the below code,please help.. ??? y = x + realW*d1 - d2; | Error: The expression to the left of the equals sign is not a valid target for an assignment. Click to expand... you did not define what is x in the program
Jun 24, 2011 #4 vipinlal Full Member level 6 Joined Mar 8, 2010 Messages 357 Helped 76 Reputation 152 Reaction score 60 Trophy points 1,308 Location India Activity points 3,191 Sorry for the dumb question guys.. The problem wasnt with the definition of 'x'. I removed the brackets( { } ) after the 'statement' and it worked..
Sorry for the dumb question guys.. The problem wasnt with the definition of 'x'. I removed the brackets( { } ) after the 'statement' and it worked..