A and B are in attached Sign in to comment. I'd like to divide the first row of A for the first colum (element) of B, second row of A for the second column in B, and so on. A rand (100) tic for i 1:1000 diag (1./sum (A,2))A end toc tic for i 1:1000 bsxfun (rdivide, A, sum (A,2)) end toc. Accepted Answer: per isakson A.mat B.mat Hi, I have a matrix A (7x1001) and a matrix B (1x7). x rdivide(A,B) is an alternative way to divide A by B, but is rarely used. vectors with different orientations (one row vector and one column vector) implicitly expand to form a matrix. Column will divide each row of the matrix, and row vector will divide each column. This MATLAB function divides each element of A by the corresponding element of B.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |