# dzh - w for i=1:N-1

This preview shows pages 1–2. Sign up to view the full content.

%% shear % N = 1000; L = 10; x = linspace(0,L,N); h = L/(N-1); o = [5, 1, 0.1, 0.001]; V=zeros(length(o),length(x)); M=zeros(length(o),length(x)); M(1) = 0; V(1) =0; V for k = 1:length(o) for i = 1:length(x) w(k,i) = 10.*exp((-((x(i))-5).^2)./(2.*o(k))); end end e hold on title('w(x) for various sigma') xlabel('x') ylabel('w(x)') plot(x,w(1,:),'b') plot(x,w(2,:),'r') plot(x,w(3,:),'g') plot(x,w(4,:),'m') p legend('sigma 5','sigma 1','sigma 0.1','sigma 0.001') l %% Shear % V(:,1) = 0; V for t=1:length(o) for i= 1:length(x) V(t,i) = %% % w = w(1,:)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: w for i=1:N-1 V(1)=V(1)+((h/6)*(w(x(i))+4*(1/2)*(w(x(i))+w(x(i+1)))+w(x(i+1)))); % M(1)=M(1)+((h/6)*(-x(i)*w(x(i))-((x(i)+x(i+1))/2)*4*w((x(i)+x(i+1))/2). .. % -x(i+1)*w(x(i+1)))); end V(1); % M(1); % for k=1:N-1 for j=1:k V(k+1) = V(k+1)+((h/6)*(-w(x(j))-4*(1/2)*(w(x(j))+w(x(j+1)))-w(x(j+1)))); end V(k+1) = V(k+1) + V(1); end e %% for g=1:N-1 for f=1:g M(g+1)=M(g+1)+((h/6)*(V(f)+4*(1/2)*(V(f)+V(f+1))+V(f+1))); end M(g+1)=M(g+1)+M(1); end e figure plot(x,V) p figure plot(x,M)...
View Full Document

## This note was uploaded on 02/18/2010 for the course ENGINEERIN 7 taught by Professor Patzek during the Spring '08 term at Berkeley.

### Page1 / 2

dzh - w for i=1:N-1

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online