multiply scalar with struct regarding
显示 更早的评论
is possible to multiply a scalar value with struct field?if possible plz help me?
回答(1 个)
James Tursa
2018-1-19
Well, just this:
s.f = rand(3); % a matrix in a struct field
x = rand; % a scalar
result = x * s.f; % multiply a scalar with a struct field
Was there something else to your problem that is more involved than this?
类别
在 帮助中心 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!