I'm trying to create code that will replicate the functionality which Excel has when mutilplying variables together to then display in a table

1 vue (au cours des 30 derniers jours)
For a course project we are creating heat exchangers and making design changes but I want to be able to tabulate the different parameters which I used before. Is there a way to do this without creating a new variable everytime, or a way to execute equations in an array. Basically can you replicate what excel does where you can drag down from a cell with an equation and it keeps the equation but updates the variables. Sorry if it doesn't make complete sense :)
  2 commentaires
Matthew Hole
Matthew Hole le 19 Oct 2018
Dnsty = 2700;
w1 = [0.4];
L1 =[0.6];
LH1 =[0.003];
NoLay = [10];
TotL = [20];
NumSP = [2];
ThkSP = [0.008];
VolSP = [(2*(w1*L1*ThkSP))];
WSP = [(VolSP*Dnsty)];
ThkSep = [0.0015];
NumSep = [(TotL+1)];
VolSep = [((w1*L1*ThkSep)*NumSep)];
WSep = [(VolSep*Dnsty)];
WSB = [0.002];
NumC = [(TotL)];
VolC = [((w1*LH1*WSB)*NumC)];
WC = [VolC*Dnsty];
NumH = [(TotL)];
VolH =[((L1*LH1*WSB)*NumH)];
WH = [(VolH*Dnsty)];
TotH = [((LH1*TotL)+(ThkSep*NumSep)+(ThkSP*NumSP))];
TotW = [(WSP+WSep+WC+WH)];
f = figure('Name','Heat Exchanger','Position',[100 100 450 400]);
val = {w1(1,1),L1(1,1),LH1(1,1),NoLay(1,1),TotL(1,1),TotH(1,1),NumSP(1,1),ThkSP(1,1),...
VolSP(1,1),WSP(1,1),ThkSep(1,1),NumSep(1,1),VolSep(1,1),WSep(1,1),WSB(1,1),NumC(1,1),...
VolC(1,1),WC(1,1),NumH(1,1),VolH(1,1),WH(1,1),TotW(1,1)};
columnname = {'WidthParam','LengthParam','LayerHeight','NumLayersEachSide','TotalNumLayers','TotalHeight','ThicknessSP','NumofSP',...
'VolumeSP','WeightSP','ThicknessSep','NumofSepPlates',...
'VolumeSep','WeightSep','WidthSB','NumofColdBars','VolumeSBC','WeightSBC','NumofHotBars','VolumeSBH','WeightSBH','TotalWeight'};
rowname = {'Test 1','Test 2','Test 3','Test 4'};
t = uitable('Parent',f,'Units','normalized','Position',[.1 .1 1.9 .9],'Data',val,'ColumnName',columnname,'RowName',rowname)
This is the code I have to create the table using the specific values/variables but Im unsure how to develop it so I can add additional values to create more tests.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by