Which is faster, a row vector or a column vector? Can anyone answer me please?
Ältere Kommentare anzeigen
I am trying to do some integration so I am defining the output as a matrix, my question is which definition will give me faster results to define my matrix :
A = zeros(1,n) or A = zeros(n,1)?
Regards
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 13 Mai 2015
2 Stimmen
For any of the arithmetic operations, a row vector is exactly the same speed as a column vector. However, extracting a column vector from a matrix is faster than extracting a row vector. Also, library functions often are defined as returning column vectors and their logic is sometimes marginally faster on column vectors.
1 Kommentar
Avan Al-Saffar
am 14 Mai 2015
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!