How can I extract the first element of a vector in simulink?

97 Ansichten (letzte 30 Tage)
Ziad Almalak
Ziad Almalak am 18 Jul. 2018
Bearbeitet: Michael Hodgson am 7 Okt. 2021
I have a [1500x1] vector in simulink. I wish to extract the first element from this vector. I have attempted to use a MATLAB function block to perform this task, but it yields me nothing.

Antworten (1)

Honglei Chen
Honglei Chen am 18 Jul. 2018
Bearbeitet: Honglei Chen am 18 Jul. 2018
You should be able to use a Selector block. You can find the reference page at
HTH
  3 Kommentare
Honglei Chen
Honglei Chen am 18 Jul. 2018
Looks like although your output is 1500x1, it is configured as a variable size signal. I would set it as
  • Number of input dimensions: 2
  • Index mode: one-based
  • 1 -> Index Option: Index vector (dialog) -> Index: 1
  • 2 -> Index Option: Index vector (dialog) -> Index: 1
HTH
Michael Hodgson
Michael Hodgson am 7 Okt. 2021
Bearbeitet: Michael Hodgson am 7 Okt. 2021
Can I use a Selector block to get the last element of an array? As in, "A[end]"?

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by