How to plot this code?
이전 댓글 표시
Hey guys I've been trying to learn mathlab and I ended up writing this code the code below:
clc
close all;
clear
L=input("L= ");
Delta_a=input("Delta a= ");
W=input("W= ");
E=input("Modulus Yang= ");
I=input("I= ");
EI=E*I;
N=L/Delta_a;
n=0;
while n<N
a=n*Delta_a;
y1=(-W/(24*EI))*((a^4)-(4*L*(a^3)+(6*(L^2)*(a^2))));
Rd=((3*EI)/(L^3))*(y1);
tb1=(-W*(L^3))/(6*EI);
tb2=(Rd*(a^2))/(2*EI);
yb1=(-W*(L^4))/(8*EI);
yb2=((Rd*(a^3))/(3*EI))+((L-a)*tb2);
thetaB=tb1+tb2;
yB=yb1+yb2;
n=n+1;
if(n>N) end
fprintf('n= #%d\n', n);
fprintf('Reaction D= #%d\n', Rd);
fprintf('Shib= #%d\n', thetaB);
fprintf('Khamesh= #%d\n', yB);
end
So here is my question:
How can I plot yB on diffrent values of a?
My guess is to turn it into a matrix but I have no idea about how to that.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!