Clear Filters
Clear Filters

exporting data to seperate excel sheets

2 views (last 30 days)
LINDO MTSWENI
LINDO MTSWENI on 2 May 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);

Answers (0)

Community Treasure Hunt

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

Start Hunting!