Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8265543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:50:44+00:00 2026-06-08T04:50:44+00:00

I have a 30-vector, x where each element of x follows a standardised normal

  • 0

I have a 30-vector, x where each element of x follows a standardised normal distribution.
So in Matlab,

I have:

for i=1:30;
x(i)=randn;
end;

Now I want to create 30*30=900 elements from vector, x to make a 900-vector, C defined as follows:

enter image description here

I am unable to do the loop for two variables (k and l) properly. I have:

for k=1:30,l=1:30;
C(k,l)=(1/30)*symsum((x(i))*(x(i-abs(k-l))),1,30+abs(k-l));
end

It says ‘??? Undefined function or method ‘symsum’ for input arguments of type
‘double’.
‘

I hope to gain from this a 900-vector, C which I will then rewrite as a matrix. The reason I have using two indices k and l instead of one is because I eventually want these indices to denote the (k,l)-entry of such a matrix so it is important that that my 900-vector will be in the form of C = [ row 1 row 2 row 3 … row 30 ] so I can use the reshape tool i.e.

C'=reshape(C,30,30)

Could anyone help me with the code for the summation and getting such a 900 vector.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:50:46+00:00Added an answer on June 8, 2026 at 4:50 am

    Let’s try to make this a bit efficient.

    n = 30;
    x = randn(n,1);
    
    %# preassign C for speed
    C = zeros(n); 
    
    %# fill only one half of C, since it's symmetric
    for k = 2:n
       for l = 1:k-1
          %# shift the x-vector by |k-l| and sum it up
          delta = k-l; %# k is always larger than l
          C(k,l) = sum( x(1:end-delta).*x(1+delta:end) );
       end
    end
    
    %# fill in the other half of C
    C = C + C';
    
    %# add the diagonal (where delta is 0, and thus each
    %# element of x is multiplied with itself
    C(1:n+1:end) = sum(x.^2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a vector a and want to multiply each element recursively with b
Say, I have a vector y, and I want to check if each element
I have a vector where I keep an incrementing data. Normally each element of
I have two vector e and g . I want to know for each
If I have a container ( vector , list , etc) where each element
I have a std::vector and I want to check a specific attribute of each
So I have a list, each element of which is a numeric vector. Each
I have a vector such V = [0.5,0.6,0.2,0.8...] and I want to map each
I have a list of length 130,000 where each element is a character vector
If I have vector<T> list Where each element in the list is unique, what's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.