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 8735749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:08:37+00:00 2026-06-13T10:08:37+00:00

I am trying to generate an array from some starting values using this formula

  • 0

I am trying to generate an array from some starting values using this formula in MATLAB:

yt = a0 + ∑i=1p (ai ⋅ yt-i), t ≥ p

p is some small number compared to T (max t). I have been able to make this using two for cycles but it is really slow. Is there some easy way to do it?

First p values of y are provided and vector a (its length is p+1) is provided too…

This is what I have so far, but now when I tried it, it doesn’t work 100% (I think it’s because of indexing from 1 in MATLAB):

y1 = zeros(T+1, 1);
y1(1:p) = y(1:p);

for t = p+1:T+1
    value = a1(1);
    for j = 2:p+1
        value = value + a1(j)*y1(t-j+1);
    end
    y1(t) = value;
end

EDIT: I solved it, I am just not used to Matlab indexing from 1…

  • 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-13T10:08:38+00:00Added an answer on June 13, 2026 at 10:08 am
    y1 = zeros(T+1, 1);
    y1(1:p) = y(1:p);
    
    for t = p+1:T+1
        value = a1(1);
        for j = 2:p+1
            value = value + a1(j)*y1(t-j+1);
        end
        y1(t) = value;
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using cakephp and trying to pass an array from the view to
I'm trying to generate select names from a mysql database by using the rand()
I'm trying to generate an array of integers contains randoms adding up to a
Im trying to generate a color gradient using ColdFusion. My current code below works
I'm trying to generate the following html code using cl-who: <html> <body> <div id=cnt_1></div>
I am trying right now to declare a large character array. I am using
I am having some trouble understanding this brute force approach. I am using Perl
I'm trying to implement some data structures (like HAMP-hash array mapped trie) in Common
I am trying to copy the contents of an array generated from a Perl
I'm trying to construct an np.array by sampling from a python generator, that yields

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.