Removing a column from a Matrix product in one expression
1 次查看(过去 30 天)
显示 更早的评论
In MATLAB I want to achieve the following in one expression,
C = A * B;
C = C(:, 2:end);
Naturally it'd be something like
C = (A * B)(:, 2:end);
However that gives me an invalid expression error. How do I do this properly?
0 个评论
采纳的回答
David Fletcher
2021-4-20
Strange as it may seem, try this
C= A * B(:, 2:end)
Terser is not always better, especially when things start to become confusing and ambiguous
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!