Author Topic: Solve this Equation - stuck up with small thing  (Read 151 times)

Offline sandy131

  • Newbie
  • *
  • Posts: 1
  • Matlab Forum
    • View Profile
Solve this Equation - stuck up with small thing
« on: February 04, 2010, 10:24:24 AM »


x = 1 -1 1 -1 1 -1 1

means x(1) = 1 and x(2) = -1 and so on tell x(7)

M(k) = sigma{x(i).*x(i+k)+x(i).*x(i+k-1).*x(i+k+1)}

for i = 0 to 6 - k

initially it should b solver by taking k=0 then k=1 and so on to k=7.

like wise we get m(0) m (1) and so on till m (7)

can any one do this ??
plz
thnx in advance!!


i have already solved part of it

  • clear;
    close all;
    x=[1 -1 1 -1 1 -1 1 zeros(1,8)];
    fork=1:7;
        for j=1:7;
            for i=1:7;
           r(j,i)=(x(1,i).*x(1,i+k))+(x(1,i).*x(1,i+k+1).*x(1,i+k-1));
            end;
        end;
        z(k,:)=sum(r,2);
    end;
    y=z(:,1)

    out put im getting is 5 -5 3 -3 1 -1 0

    but actual out put i should get is 6 5 -5 3 -3 1 -1

    first answer is missing and last extra 0 is coming

Matlab Forum

« on: »

 

  Subject / Started by Replies Last post
0 Replies
492 Views
Last post April 05, 2009, 03:40:00 PM
by fahad20
0 Replies
239 Views
Last post June 03, 2009, 06:15:26 AM
by ritwik
0 Replies
467 Views
Last post August 20, 2009, 01:19:20 PM
by shahrirsani
0 Replies
75 Views
Last post July 09, 2010, 11:06:49 AM
by theasus
0 Replies
49 Views
Last post July 14, 2010, 11:55:58 AM
by jantjon