NAN problem in MATLAB, Surf command
조회 수: 1 (최근 30일)
이전 댓글 표시
hi dear friends I am back with another problem. I am trying to write a code in MATLAB to plot the following series, but it doesn't work.
I took the ";" to see where the problem is. when I changed m's range to for example 1 to 100 it gives the values for S1 , but as I change it to higher number it returns:
S1= NAN
. . . S1= NAN
here is my code!(first I just want to calculate the series and then I will multiply it by (T1*2) (by the way the ranges for x and y are given and i can not change them)
for x=0:0.01:0.3;
for y=0:0.01:0.4;
Sum1=0;
for m=1:10000
S1=((1-cos(m*pi))/(m*pi))*((sinh(m*pi*(0.4-y)/0.3))/sinh(m*pi*0.4/0.3))*(sin(m*pi*x/0.3))
Sum1=Sum1+S1;
end
end
(my other question is if I can use 'Surf to plot T in x and y ranges?) I will appreciate your help, I am new to MATLAB. thank you :)
댓글 수: 1
Walter Roberson
2014년 1월 5일
My suspicion would be that you are running into zero divided by zero, or else zero times infinity
답변 (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!