필터 지우기
필터 지우기

Gain block ignored :

조회 수: 1 (최근 30일)
Doug Bell
Doug Bell 2018년 8월 1일
댓글: youjarr 2021년 5월 7일
I have a Simulink model with a gain block that has a ToWorkspace before and after, yet the ToWorkspace traces are identical even though the gain has been set to 64, any ideas what may be causing this?
  댓글 수: 1
Jim Riggs
Jim Riggs 2018년 8월 1일
Need more information. What are the settings in each "To Workspace" block?
Variable Name
Data limit
Decimation
Save Format
Sample time

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

답변 (3개)

Fangjun Jiang
Fangjun Jiang 2018년 8월 1일
The input value to the Gain block is constant zero? Need more info to see the problem.
  댓글 수: 2
Doug Bell
Doug Bell 2018년 8월 1일
thanks Fangjun - it needed a convert datatype block prior to the gain block , it was a Boolean flag toggling between 0 & 1, then multiplied by a power of two, converting to a float before the gain seems to have fixed it
Fangjun Jiang
Fangjun Jiang 2018년 8월 1일
Without the data type conversion block, the output should still be 64 when the input is boolean true, right?

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


Doug Bell
Doug Bell 2018년 8월 1일
that was the assumption but it took the datatype conversion block to get what I wanted

youjarr
youjarr 2021년 5월 7일
Hey Guys,
I have an similiar issue.
I have an Signal which is not 0. Then I put an 0 Gain to it... with an parameter which is read from the base workspace.
That value is 0 so I would thing the output of the Signal*0 is 0... but it isn´t it has the value of the signal.
But when I write the 0 directly into the gain hen it works and the output is 0.
The datatype conversion has no effect... .
  댓글 수: 2
Fangjun Jiang
Fangjun Jiang 2021년 5월 7일
You are saying that you have a Gain block, its "Gain Value" is a parameter from the base workspace, the value of the parameter is 0, yet, the output of the Gain block is non-zero.
It is strange. I would double check the value of the parameter, the name of the parameter, lower case, upper case, etc.
There is a chance, that there is a parameter with the same name, in the model workspace, its value is non-zero. The variable in the model workspace takes precedent over the base workspace, if their names are the same.
youjarr
youjarr 2021년 5월 7일
You were right. Somehow I saved a value in my model workspace.
Thank you very much.
Have a nice weekend.

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

카테고리

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

태그

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by