フィルターのクリア

how to enter function expoential function with two variable

1 回表示 (過去 30 日間)
YOGESHWARI PATEL
YOGESHWARI PATEL 2016 年 2 月 7 日
回答済み: Star Strider 2016 年 2 月 7 日
calculate u(x,t)= exp (a*x+b*t)

回答 (1 件)

Star Strider
Star Strider 2016 年 2 月 7 日
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

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by