exporting data to seperate excel sheets
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
can someone please help me with the following question regarding the attached code. the question is : write each of the output variables of the StressCalc Function to seperate sheets in the Excel file Results.xlsx. The sheets must have the same names as the variables that are written to them.
below is the code i created to calculate the required variables.
function [CriticalPoints, ShearStresses, BendingStresses, AxialStresses, VonMisesStresses] = StressCalc(ForceData,Areas,Is, Heights)
############## INPUT SUB-FUNCTION CODE BELOW THIS LINE ###################
for f=1:1:length(Areas);
C(f)=Areas(f);
end
F=(3*ForceData.ShearForce(:,2))'./(2*C)';
ShearStresses=round(100*F)/100;
for d=1:1:length(Areas);
A(d)=Heights(d)./2;
end
B=(ForceData.BendingMoment(:,2)*A)'./Is;
BendingStresses=round(100*B)/100;
for k=1:1:length(Areas);
P(k)=Areas(k);
end
T=(ForceData.AxialForce(:,2))'./P';
AxialStresses=round(100*T)/100;
VonMisesStresses=sqrt((AxialStresses+BendingStresses).^2+3*(ShearStresses).^2);
CriticalPoints=max(VonMisesStresses,[],2);
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!