필터 지우기
필터 지우기

exporting data to seperate excel sheets

조회 수: 2 (최근 30일)
LINDO MTSWENI
LINDO MTSWENI 2019년 5월 2일
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개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by