필터 지우기
필터 지우기

Save a value to variable (Simulink)

조회 수: 5 (최근 30일)
Agamemnon Krasoulis
Agamemnon Krasoulis 2012년 5월 21일
Hi,
I am using the Submatrix block in Simulink, in which I select the output matrix to contain all the rows of the input matrix and the first x columns (using the "Ending column: index" parameter). I would like though to choose x (the number of columns) according to some other calculations taking place in my algorithm. The Submatrix block, however, does not offer the option to pass its parameters as inputs.
Any idea of how I could achieve that? A possible solution would be if I could save the value of x to a variable and then give the variable name for the Ending column index parameter... Is there any way to do that?
  댓글 수: 2
Agamemnon Krasoulis
Agamemnon Krasoulis 2012년 5월 21일
I am afraid that this doesn't help much. I guess if someone wants to learn what the Submatrix block is, he would look it up on MATLAB's help anyway..
K E
K E 2012년 5월 21일
Sorry, I have removed the comment.

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

채택된 답변

Guy Rouleau
Guy Rouleau 2012년 5월 21일
Use the Selector block:
You will be able to select rows or columns using a signal.
Based your description, the Index Option "Starting and ending indices (port)" should allow you to select a variable number of columns.
If you are not familiar with variable-size signals, I also recommend going through the "Working with Variable-Size Signals" section of the documentation:
  댓글 수: 1
Agamemnon Krasoulis
Agamemnon Krasoulis 2012년 5월 22일
Thanks. This really helped!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Array and Matrix Mathematics에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by