Error: File: centraldiff.m Line: 1 Column: 11 Unbalanced or unexpected parenthesis or bracket
Show older comments
function[U(m+1)]=centraldiff(Tn,zeta,U(1),U(2),acc(m),dt)
%Tn=2*pi*sqrt(m/k)
%U(1)=0; % displacement at point t=0 of SDOF
%V(1)=0; % velocity at point t=0 of SDOF
%zeta=0.05;
%Tn=2.5
%U(2)=0;
for m=2:20;
U(m+1)=-acc(m)/(1/dt^2+2*pi*zeta/Tn*dt)+((-1/dt^2+2*pi*zeta/Tn*dt)/(1/dt^2+2*pi*zeta/Tn*dt))*U(m-1)+((-4*pi^2/Tn^2+2/dt^2)/(1/dt^2+2*pi*zeta/Tn*dt))*U(m)
end
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!