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

  • SEARCH
  • Home
  • 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 6737347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:14:17+00:00 2026-05-26T11:14:17+00:00

Still very new to programming… I have 9×1 Vectors at time t, t+1, t+2

  • 0

Still very new to programming…

I have 9×1 Vectors at time t, t+1, t+2 etc.

[10 10 10 10 10 10 10 10 10]’

and matrices. Each matrix is 9×9 and also at time 1, t+1, t+2 etc. =

 1     0     0     0     0     0     0     0     0
 0     1     0     0     0     0     0     0     0
 0     0     1     0     0     0     0     0     0
 0     0     0     1     0     0     0     0     0
 0     0     0     0     1     0     0     0     0
 0     0     0     0     0     1     0     0     0
 0     0     0     0     0     0     1     0     0
 0     0     0     0     0     0     0     1     0
 0     0     0     0     0     0     0     0     1

They are 3d matrices and I want to make them 4d in the future.

I want to multiply vector(:,:,t) with the diagonal of matrix at time t and output vector(:,:,t+1).

So in short…

vector t multiplied by diag matrix t = vector t+1

vector t+1 multiplied by diag matrix t+1 = vector t+2

vector t+2 multiplied by diag matrix t+2 = vector t+3 … and so on.

the diagonal numbers change in each time step but for simplicity sake, let’s keep them all at 1 for the moment.

I’ve tried using diag but it states I have to use a 2D input so only works when I ignore t.

Cheers for your help guys – it’s helping me learn a lot. Any hints or solutions will be much appreciated. I know you guys know the simplest and most efficient solutions.

  • 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-05-26T11:14:18+00:00Added an answer on May 26, 2026 at 11:14 am

    Here you go:

    n = 10;
    
    % Make sample data
    t = zeros(9,1,n);
    t(:,1,1) = 1;
    T = repmat(diag(ones(9,1)), [1 1 n]);
    
    % Loop though to fill in t based on previous t and T
    for i = 2:n
      t(:,1,i) = t(:,1,i-1) .* diag(T(:,:,i-1));
    end
    

    Now all of t should be 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I'm still very new to SASS and no programming guru. I have ten
Very new to web programming still and I don't really have a specific question
I'm still very new at programming, and our local SSIS genius isn't here today
I'm still very new to Object Oriented programming and am having problems with the
I'm very new to jquery and programming in general but I'm still trying to
I'm very new to Python and multithreaded programming in general. Basically, I have a
I'm still very new to programming and I want to write the cleanest code
Please be gentle, as I'm still new to web programming and -very- new to
I'm new to programming and I have very little knowledge of python. I'm a
I am still very new to programming and trying to learn with rails. I

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.