Simulink bit operations
5 次查看(过去 30 天)
显示 更早的评论
Hi all, I wanted to ask if from a number of bits that are represented with 1 and 0 is possible to invert the ones to -1 each lets say two bits? Thanks in advance.
2 个评论
Fangjun Jiang
2011-12-17
Not clear to me what do you mean by "from a number of bits" and "to invert the ones to -1 each lets say two bits". Are you saying that if you have an inputs of 10 bits, six 1s and four 0s, alternate randomly, you want to invert the first two 1s into -1?
回答(1 个)
Paulo Silva
2011-12-16
[1 0]------>Gain(-1)----->[-1 0]
Use the Gain block and define that gain as -1
7 个评论
Walter Roberson
2011-12-16
Ah, instead of a step function, you could perhaps use a Repeating Sequence block, as mentioned at http://www.mathworks.com/matlabcentral/answers/15874-hi-all-i-am-having-a-difficulty-in-switching-a-signal-i-need-a-switch-in-simulink-that-must-be-on
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 General Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!