3 d plot for the symbolic calculation
    3 views (last 30 days)
  
       Show older comments
    
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 Comments
Answers (1)
  Star Strider
      
      
 on 15 Nov 2022
        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 Comments
See Also
Categories
				Find more on Calculus in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





