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

조회 수: 53 (최근 30일)
Ziad Almalak
Ziad Almalak 2018년 7월 18일
편집: Michael Hodgson 2021년 10월 7일
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.

답변 (1개)

Honglei Chen
Honglei Chen 2018년 7월 18일
편집: Honglei Chen 2018년 7월 18일
You should be able to use a Selector block. You can find the reference page at
HTH
  댓글 수: 3
Honglei Chen
Honglei Chen 2018년 7월 18일
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 2021년 10월 7일
편집: Michael Hodgson 2021년 10월 7일
Can I use a Selector block to get the last element of an array? As in, "A[end]"?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by