Effacer les filtres
Effacer les filtres

how to enter function expoential function with two variable

1 vue (au cours des 30 derniers jours)
YOGESHWARI PATEL
YOGESHWARI PATEL le 7 Fév 2016
calculate u(x,t)= exp (a*x+b*t)

Réponses (1)

Star Strider
Star Strider le 7 Fév 2016
Write it as an anonymous function, using vectorised operations:
u = @(x,t) exp (a.*x+b.*t);
then provide its parameters and variables, and see what it produces:
a = 5.0;
b = -0.2;
u = @(x,t) exp (a.*x+b.*t);
x = linspace(0,4);
t = linspace(0,2);
[X,T] = meshgrid(x,t);
U = u(X,T);
figure(1)
surf(X, T, U)
grid on

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by