Subtraction of a constant from a matrix column
42 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all, I'm trying to subtract a constant from every element in a matrix column, as the title suggests. The code I have is the following, however it does not work:
ver(:,1) = ver(:,1)-X;
Example. If we take ver = [1 2 3 ; 4 5 6], and X=3. So what I want to get by this subtraction is ver = [-2 2 3 ; 1 5 6].
Any help is appreciated. Thanks in advance! Cheers!
0 Kommentare
Antworten (2)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!