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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:57:26+00:00 2026-06-05T01:57:26+00:00

I have two vector signals with different lenghts in a simulink-model. Now, I want

  • 0

I have two vector signals with different lenghts in a simulink-model. Now, I want to add the values of the shorter signal to specific elements of the longer one. Let me explain that using an example:

Let’s assume, signal A has the value [1 2 3 4 5], signal B has the value [2 4 8]. I want to add the value of B to the 1st, 3rd and 5th element of A, resulting in [3 2 7 4 13]. The corresponding matlab-command would be A([1 3 5])=A([1 3 5])+B.

The same thing should be possible in Simulink by using the Insert Zero-Block to pad B to the same length as A and then adding both vectors. Unfortunately, this Block requires the Communications System Toolbox which I do not have. Besides using an embedded matlab function, do you see any other possibility?

  • 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-05T01:57:27+00:00Added an answer on June 5, 2026 at 1:57 am

    You can try using a selector block to emulate the indexing in MATLAB, I don’t have Simulink right now, so here’s a powerpoint version of a model. In the selector block, you can either hard code the index you need, or you can feed the index in using a port on the block.

    In this case, the model implements,

    Y = A([1 3 5 7 9]) + B;
    

    For more info, see the Selector block documentation.

    enter image description here

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

Sidebar

Related Questions

I have two vectors of values and one vector of weights, and I need
Imagine that we have two static libraries built with different implementations of std::vector .
I have two arrays values and keys both of the same length. I want
I have two vector objects that contain different types of data that are ordered
I have two algorithms that I'm implementing: AlgorithmA which works with Vector values and
I have two vectors of floats and i want them to become one vector
I have two vc++ dll projects, which will generate two dlls. A vector<vector<string>> object
I have a relatively simple algorithm that walks an std::vector looking for two neighbouring
I have two vector<T> in my program, called active and non_active respectively. This refers
If I have two vector coordinates representing positions on the surface of the earth

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.