필터 지우기
필터 지우기

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 CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by