Info
此问题已关闭。 请重新打开它进行编辑或回答。
How to multiply only some column and rows for a given number?!
1 次查看(过去 30 天)
显示 更早的评论
I want to multiply for 2.5 the all the rows (2 in total) but not the 1 column, how should I do?
Like this I litterally get rid of the column 1 after multiplying for 2.5.
scores = score(1:2,2:21).*(2.5)
Thank you for you help
Best
0 个评论
回答(1 个)
Fabio Freschi
2020-1-2
You are close to the answer, but you need to keep the first column
% your matrix with data
A = rand(2,21);
% multiply all but the first column
B = [A(:,1) A(:,2:end)*2.5];
2 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!