Help with oscillation and plotting

2 vues (au cours des 30 derniers jours)
Jacob Andréasson
Jacob Andréasson le 9 Nov 2019
Skärmavbild 2019-11-09 kl. 17.33.06.png
Hey!
I am finished with a and b but i need much help with c. Down below is my script for a and b but i do not know where to start with c. Could someone please help me with the script for c because i am going on funeral tommorrow and i should be finished on monday morning...?
%% Exercise 2.a
clear
clf
clc
k=1
L=6
x=linspace(0,L);
fplot(@(x) (((2.*k)./L).*x), [0,(L/2)])
hold on
fplot(@(x) (((2.*k)./L).*(L-x)), [(L/2),L])
%% Exercise 2.b
clear
clf
clc
k=1;
L=6;
T=10;
x=linspace(0,L,100); t=linspace(0,T,100);
n=1:100;
for i=1 : length(x)
for j=1 : length(t)
u(i,j)=(8/(pi^2)).*sum((1./(n.^2)).*sin(n.*pi/2).*cos(n.*pi.*t(j)/6).*sin(n.*pi.*x(i)/6));
end
end
surf(t,x,u)
xlabel('t'); ylabel('x'); zlabel('u')
title('Exercise 2.b');
%% Exercise 2.c

Réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by