Assignment has more non-singleton rhs dimensions than
non-singleton subscripts
Error in (line 18)
M(i,j)=[D1_iron,D1_pvc];
Why am I getting this error? How do i store the D1_ironand pvc in the created matrix?
g=9.81;
D_iron = [.12:.02:.36]; D_pvc = [.1:.02:.3]; D_castiron = .3; %Pipe diameters
Qin =.15;
peak = input(‘Is it curently peak demand? (1 for yes, 0 for no):’);
if peak == 1
Qin = .3;
end
M = zeros(length(D_iron),length(D_pvc));
n=1;
for i = 1 : length(D_iron)
for j = 1 : length(D_pvc)
D1_iron = D_iron(i);
D1_pvc = D_pvc(j);
M(i,j)=[D1_iron,D1_pvc];
n=n+1;
Expert Answer
An answer will be send to you shortly. . . . .