n=5; no_customer=poissrnd(10,[1,n]);
per_cus_D=sqrt(2.5)*rand(1,n)+15;
for a=1:n
total_demand(a)=sum(sqrt(2.5)*rand(no_customer(a),1)+15)
end;
total_demand =
206.1423
total_demand =
206.1423 188.0836
total_demand =
206.1423 188.0836 112.3561
total_demand =
206.1423 188.0836 112.3561 172.0771
total_demand =
206.1423 188.0836 112.3561 172.0771 109.1498
我只想要最后的一行 total_demand = 206.1423 188.0836 112.3561 172.0771 109.1498 ,但MATLAB在计算最后一行前会多计4次,如果把N设大一点,就需要运行很久。怎样才能令MATLAB直接计算最后一项。