Scalar Multiplication of different values at same time
3 次查看(过去 30 天)
显示 更早的评论
I have a function -
[x1 x2 x3] = somefunction(y1,y2);
now i want to multiply the [x1 x2 x3] by scalar value z.
[x1 x2 x3] = [x1 x2 x3] .*z; % Want to do like this which is not valid as per the codde
instead of doing the multiplication individually i want to do the multiplication all at a time.
Is there any way to mulitiplication all at a time.
0 个评论
回答(1 个)
madhan ravi
2019-6-26
编辑:madhan ravi
2019-6-26
Assign the values with one output for instance as variable X which consists all the values in it.
6 个评论
per isakson
2019-6-27
编辑:per isakson
2019-6-27
AFAIK: NO! However, some do weird tricks with subsref and subsasgn.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!