How can I multiply each bus element with a constant?
Show older comments
I created a Bus with more than 1000 Signals. Is there a way to multiply each element (or parts of the bus) with a constant without using a busselector?
Answers (1)
Mark McBroom
on 19 Mar 2017
0 votes
This can be done easily with a ML Function block. Code in ML Fcn Block:
y = u; elemNames = fieldnames(u); for i=1:numel(elemNames) y.(elemNames{i}) = u.(elemNames{i})*2 + i; end
See atttached example.
1 Comment
Alexander Gebel
on 21 Mar 2017
Categories
Find more on Sources in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!