MATLAB: Matrix multiplication with constant

matrix multiplication with constant

RR=5;
RS=750:150:3600;
for i=1:length(RS)
k(i)=RR.*RS(i)
end
am i not supposed to get the answer k(i) in the form of matrix ?
Here RS is matrix of size 1*20.
if i want to get k(i) in terms of 1*20 , what shall i do ? Please tell me. Thankyou.

Best Answer

k is 1x20
>> RR=5;
RS=750:150:3600;
for i=1:length(RS)
k(i)=RR.*RS(i);
end
>> k
k =
Columns 1 through 11
3750 4500 5250 6000 6750 7500 8250 9000 9750 10500 11250
Columns 12 through 20
12000 12750 13500 14250 15000 15750 16500 17250 18000