Effacer les filtres
Effacer les filtres

exporting data to seperate excel sheets

2 vues (au cours des 30 derniers jours)
LINDO MTSWENI
LINDO MTSWENI le 2 Mai 2019
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);

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by