Subtraction matrix for all values

1 次查看(过去 30 天)
Matthew Worker
Matthew Worker 2020-11-25
编辑: N/A 2020-12-4
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 个)

David Hill
David Hill 2020-11-25
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

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by