Plotting complementary error function with 2 variables

I am tryimg to plot complementary error function for two variables but it keeps giving me empty figure. Here is my code:
T0 = 100;
T1 = 70;
c = 1;
u = @(x,t) (T0-T1)*erf(x./(2*c*sqrt(t)))+T0;
fsurf(u)

답변 (2개)

KSSV
KSSV 2022년 11월 7일
T0 = 100;
T1 = 70;
c = 1;
x = linspace(-1,1) ; % define your range
t = linspace(0,10) ; % define your range
[x,t] = meshgrid(x,t) ;
u = (T0-T1)*erf(x./(2*c*sqrt(t)))+T0;
surf(x,t,u)

댓글 수: 2

Zaineb Mohamed
Zaineb Mohamed 2022년 11월 7일
편집: Zaineb Mohamed 2022년 11월 7일
but my x is and t are defined as x > 0 and t > 0 when I put linspace(0,inf) it also give empty graph
You need to provide some upper limit.....with this you cannot plot.

댓글을 달려면 로그인하십시오.

VBBV
VBBV 2022년 11월 7일
T0 = 100;
T1 = 70;
c = 1;
t = linspace(1,10,20);
syms x
u = (T0-T1)*erf(x./(2*c*sqrt(t)))+T0;
fplot(u,[1 10])
you can try using fplot function

카테고리

질문:

2022년 11월 7일

편집:

2022년 11월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by