Subtraction between a matrix and a column vector
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Akshay Vivek Panchwagh
am 5 Apr. 2022
Kommentiert: Akshay Vivek Panchwagh
am 12 Apr. 2022
So I have a matrix of the size 23x15 and a column vector of size 23x1. I need to subtract element 1 of the colum vector from the 1st row of the matrix, element 2 of the column vector from 2nd row of the matrix, and so on. Any suggestions about how I can do it?
0 Kommentare
Akzeptierte Antwort
Riccardo Scorretti
am 5 Apr. 2022
Hi. If the matrix and the vector have compatible size (= like you mentioned), it is enough to use the minus operator:
A = rand(23,15);
x = rand(23,1);
A-x
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Logical 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!