필터 지우기
필터 지우기

problem with f surf

조회 수: 3 (최근 30일)
yogeshwari patel
yogeshwari patel 2021년 6월 12일
댓글: Sulaymon Eshkabilov 2021년 6월 12일
f1 = @(x,t) 0.7*(1-tanh((0.7/2)*((x)-0.7*(t))))
syms x n
syms t
U=zeros(1,2,'sym');
A=zeros(1,2,'sym');
B=zeros(1,2,'sym');
series(x,t)=sym(zeros(1,1));
U(1)=0.7*(1-tanh((0.7/2)*x))
for k=1:3
A(1)=0;
for i=1:k
A(1)=A(1)+U(i)*U(k-i+1) ;
end
B(1)=0;
U(k+1)=(((diff(U(k),x,2)-A(1)))/k);
end
disp (U)
for k=1:4
series(x,t)=simplify(series(x,t)+U(k)*(power(t,k-1)));
end
% f2=series
f3=@(x,t) series
fsurf(f1,[-5 0 -5 5])
fsurf(f3,[-5 0 -5 5])
fsurf(f1-f3,[-5 0 -5 5])
The graph is not displayed

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 12일
THere are a few errs in your code - loop calculations and redefining 'f3'. Here is the corrected code:
...
series=0;
for k=1:4
series=series+(U(k).*(power(t,k-1)));
end
f3= series;
figure(1)
fsurf(f1,[-5 0 -5 5])
figure(2)
fsurf(f3,[-5 0 -5 5])
figure(3)
fsurf(f1-f3,[-5 0 -5 5])
  댓글 수: 2
yogeshwari patel
yogeshwari patel 2021년 6월 12일
Thank you
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 12일
Most Welcome!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by