Subtraction matrix for all values

column 1 - column 2; column 1 - column 3; column 1 - column 4...(rest of subtractions)..olumn 4 - column 4.
How would I approach this?

回答(1 个)

for m=1:size(A,2)
for n=1:size(A,2)
B(:,(m-1)*size(A,2)+n)=A(:,m)-A(:,n);
end
end

类别

在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息

编辑:

N/A
2020-12-4

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by