필터 지우기
필터 지우기

need help solving this summation

조회 수: 1 (최근 30일)
Luke Radcliff
Luke Radcliff 2016년 6월 10일
댓글: Roger Stafford 2016년 6월 11일
I need to solve this, but keep getting an error about the matrix, probably dealing with the x and y variables set.
L=3; W=5; x=linspace(0,L,10);
y = linspace(0,W,7); N=9;
P = 1:2:N
w = 2/pi .* sum(2./P .* sin(P.*pi.*x./L) .* (sinh(P.*pi.*y./L) ./ sinh(P.*pi.*W./L)))
there is a picture attached, showing the summation, I might not even be doing this right Im new to matlab. It has to be done using the sum function not symsum, a for loop also can be done to solve this if possible.
  댓글 수: 2
Walter Roberson
Walter Roberson 2016년 6월 10일
That image is too small to read clearly.
Luke Radcliff
Luke Radcliff 2016년 6월 10일
Okay I enlarged the image

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

채택된 답변

Roger Stafford
Roger Stafford 2016년 6월 11일
Make these changes in your code:
L=3;
W=5;
x=linspace(0,L,10);
y = linspace(0,W,7);
N=9;
P = 1:2:N
for ix = 1:10
for iy = 1:7
w(ix,iy) = 2/pi .* sum(2./P .* sin(P.*pi.*x(ix)./L) .* (sinh(P.*pi.*y(iy)./L) ./ sinh(P.*pi.*W./L)));
end
end
  댓글 수: 2
Luke Radcliff
Luke Radcliff 2016년 6월 11일
wouldnt I not need the sum function any more since its a for loop now.
Roger Stafford
Roger Stafford 2016년 6월 11일
You need to sum with respect to the five values in P. Either do it with the 'sum' function or make another nested for-loop (the latter of which seems a little unnecessary - 'sum' does its job quite well.)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by