How to calculate (or plot) a serie with two independent variables?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi every one, I would appreciate if you let me know how can I plot this function knowing that
- L=1 &
- both x and y are real numbers 0<x<L & 0<y<L
- n is integer (1->inf)
- f(x)=exp(-(x-L/2)^2/b) where b can be any constant
Here is my code, which didn't work (sorry new to MATLAB):
x=0:0.1:1;
y=0:0.1:1;
L =1;
symsum n x y
c=symsum((2./(sinh(n*pi)*L))*(sin((n*pi*x)./L))*(sin((n*pi*x)./L))*((sinh((n*pi*y)./L))),n,0,L)
댓글 수: 0
답변 (1개)
Mahesh Pai
2016년 10월 26일
It is my understanding that you would like to know how to plot a "symsum" expression containing two independent variables.
You can use the "ezsurf" function for MATLAB versions prior to R2016a or use the "fsurf" function for MATLAB versions R2016a and R2016b.
The following example will illustrate how to achieve plotting of a "symsum" symbolic expression using "ezsurf". For MATLAB versions R2016a and R2016b, you can replace "ezsurf" with "fsurf":
syms x t n
u = (80/pi)*symsum(exp(-(2*n-1)^2*pi^2*t/2500)*sin((2*n-1)*pi*x/50)/(2*n-1),n,1,20);
ezsurf(u,[0 250 0 50])
title('')
Refer to the following documentation for more information on "ezsurf" and "fsurf" functions:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!