Fourier series
이전 댓글 표시
how to write summation equation in matlab? can i write n ths way?
function [z1,z2,z3,z4,z5]=switching1(x)
fprintf('enter the value of ');
n=input('n');
for i=1:n
z(1)=1-[(2/pi)*symsum((-1)^i(x(i)-(sin(2*x(i))/2))),1,n]
z(n)=(2/pi)*[symsum((sin*(n-1)*x(i))/(n-1)-(sin*(n+1)*x(i))/(n+1)),1,n]
end
z=(z1-0.2)^2+[z(n)]^2;
댓글 수: 1
David Young
2011년 8월 17일
Your question seems to reveal many misconceptions, and I think you would do well to review the documentation relating to arrays and matrices in MATLAB before trying to fix this code - go through the introductory material in the users' guide. Note in particular that z(1) is not the same as z1.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!