【发布时间】:2011-10-16 22:52:46
【问题描述】:
所以我想弄清楚如何使用,
parameters = {[6 12 18 24], [1200 1800 2400 3000], [80 90 100],[80 90 100],[80 90 100]};
[r T3 Ec Et Er ] = ndgrid(parameters{:});
Allcombinations = [r(:) T3(:) Ec(:) Et(:) Er(:)];
这为我提供了原始参数的所有可能组合
我需要将每个参数组合插入到许多方程中,最好的方法是什么?
例如,如果我想拉出第一行并将相应的值插入例如,例如;
%# Note: k, Cp and T1 are predefined constants
Ec1=Ec/100;
Et1=Et/100;
Er1=Er/100;
T2s=T1*(r)^((k-1)/k);
T4s=T3*(1/r)^((k-1)/k);
T2a=((T2s-T1)/Ec1)+T1;
T4a=T3-Et1*(T3-T4s);
wca=Cp*(T2a-T1);
wta=Cp*(T3-T4a);
T5s=Er1*(T4a-T2a)+T2a;
qcombustion=Cp*(T3-T5s);
qregen=Cp*(T5s-T2a);
qin=qcombustion+qregen;
fprintf ('\n Net Work Output=%6.2f', wnet)
fprintf ('\n Back Work Ratio=%4.2f', rbw)
fprintf ('\n Thermal Efficiency=%4.2f\n', Eth)
我不确定,但我想知道如何使用Allcombinations(n,:)
非常感谢一些帮助 谢谢
【问题讨论】:
标签: matlab combinatorics