3 d plot for the symbolic calculation
1 次查看(过去 30 天)
显示 更早的评论
syms x a t
f=1
U=zeros(1,2,'sym');
A=zeros(1,2,'sym');
B=zeros(1,2,'sym');
series(x,t)=sym(zeros(1,1));
U(1)=(r-1)/((1+exp(x))^2);
for k=1:2
A(1)=0;
for i=1:k
A(1)=A(1)+U(i)*U(k-i+1) ;
end
U(k+1)=simplify(gamma((f*(k-1)+1))/gamma((f*(k)+1))*(diff(U(k),x,2)+6*U(k)-6*A(1)));
end
disp (U)
for k=1:2
series(x,t)=series(x,t)+U(k)*(power(t,k-1));
end
series
row=0;
x=0.7;
series1(r,t)=series(0.7,t)
for r=1:5
row=row+1;
col=0;
e=(r)/10;
for t=1:5
col=col+1;
f=(t);
C(row,col)=series1(e,f);
end
end
t= vpa(C,15)
fsurf(series1,[0.1 0.1 0.5],[1 1 5])
what is correct syntax to plot 3D command ? fsurf(series1,[0.1 0.1 0.5],[1 1 5]) is showing error.
0 个评论
回答(1 个)
Star Strider
2022-11-15
The problem was with the fsurf call (and ‘r’ was not defined).
This changed version:
fsurf(series1,[-50 50 0 50])
works —
syms x a t r
f=1
U=zeros(1,2,'sym');
A=zeros(1,2,'sym');
B=zeros(1,2,'sym');
series(x,t)=sym(zeros(1,1));
U(1)=(r-1)/((1+exp(x))^2);
for k=1:2
A(1)=0;
for i=1:k
A(1)=A(1)+U(i)*U(k-i+1) ;
end
U(k+1)=simplify(gamma((f*(k-1)+1))/gamma((f*(k)+1))*(diff(U(k),x,2)+6*U(k)-6*A(1)));
end
disp (U)
for k=1:2
series(x,t)=series(x,t)+U(k)*(power(t,k-1));
end
series
row=0;
x=0.7;
series1(r,t)=series(0.7,t)
for r=1:5
row=row+1;
col=0;
e=(r)/10;
for t=1:5
col=col+1;
f=(t);
C(row,col)=series1(e,f);
end
end
t= vpa(C,15)
fsurf(series1,[-50 50 0 50])
xlabel('r')
ylabel('t')
colormap(turbo)
view(120, 30)
.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!