Why do I get 'Array indices must be positive or logical values' in symsum function?
조회 수: 1 (최근 30일)
이전 댓글 표시
syms n
h=0.05;
U=0.02;
delta_t=1;
v=1.846*10^-5;
d=1.117;
t=50;
y=0.2;
P=pi;
F=symsum((1/n)*exp(-((n^2)*(P^2)*v*t)/(d*(h^2)))*sin(n*P(1-y/h)),n,1,300);
u=U*y/h-(2*U/P)*F(n);
댓글 수: 0
채택된 답변
추가 답변 (1개)
Matt J
2023년 3월 18일
편집: Matt J
2023년 3월 19일
The error is because you appear to be indexing P with a non-integer. Did you mean to write,
sin(n*P*(1-y/h))
?
댓글 수: 5
Matt J
2023년 3월 19일
Torsten's answer should give that to you, but in the meantime, since I have answered your posted question, please Accept-click the answer and, if Torsten's response doesn't get you where you need, post a new question.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!