필터 지우기
필터 지우기

Simple Question on Simulink to generate an array of values

조회 수: 3 (최근 30일)
Ash1992
Ash1992 2017년 3월 1일
댓글: Sam McDonald 2017년 3월 8일
Hello Everyone ,
I feel that its really a dumb question to be even posted on forums. but i couldn't figure out the solution for simple problem which i am facing.
The Problem is I need to generate an array of values say [1:20] (or) [1:45] (or) [1:n] (or) even zeros(1,n) ,so this n varies for every time step (using discrete mode simulation)...
How would I get these values on simulink ???
  댓글 수: 1
Sam McDonald
Sam McDonald 2017년 3월 8일
Do you mean the array varies in size for each time step? If so, what are you trying to do?
If you are simply wanting to generate an array of values that stays constant for each time step, then you can use a Constant block.
From the documentation page for the Constant block:
The Constant block generates a real or complex constant value.
The block generates scalar, vector, or matrix output, depending on:
  • The dimensionality of the Constant value parameter
  • The setting of the Interpret vector parameters as 1-D parameter
The output of the block has the same dimensions and elements as the Constant value parameter. If you specify for this parameter a vector that you want the block to interpret as a vector, select the Interpret vector parameters as 1-D parameter. Otherwise, if you specify a vector for the Constant value parameter, the block treats that vector as a matrix.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by