MATLAB: I need to divide two matrix with different rows and column

matrix division

Hi Everyone,
I have two Matrix
A= 1×12
B=11×12
I want to divide D=A(of 1st element) / B(of complete Row)
now D should have 11 Rows which all divided by 1st element in A
Is it possible to do with for loop?
Thanks a lot..!

Best Answer

Your description asks for two different things.
"I want to divide D=A(of 1st element) / B(of complete Row)"
% Fake data
A = randi(20,1,12);
B = randi(20,11,12);
D = A(1,1)./B
"D should have 11 Rows which all divided by 1st element in A"
D = B / A(1,1);
Or do you want to divide each column of A by the columns in B?
D = A ./ B;