symsum gauß, how to calculate sum of series ?

2 ビュー (過去 30 日間)
Osman Ballhysa
Osman Ballhysa 2021 年 6 月 1 日
コメント済み: Osman Ballhysa 2021 年 6 月 2 日
Hello everyone,
so this is what i was working on ,
function y = sin(x,n)
if n<=0 %if y=0/neg. Numer -->y=0
y = 0;
elseif n~= floor(n) %if y= pos.decimal-->y=NaN
y=NaN;
else
%Gauß
syms i x n
symsum (-1)^i*((x^2i+1)/factorial(2i+1)),i;1,n); is symsum the right thing to use here?
end
end
Can somebody help pls ?

回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 6 月 1 日
There are a few curcial errs in your developed code.
(1) Don't name a function with MATLAB's builtin function names. You have named sin() that is a builtin fcn of MATLAB.
(2) This exercice can be solved more efficiently in terms of computation time using numerical calcs instead of symbolic math application that would be very slow.
  1 件のコメント
Osman Ballhysa
Osman Ballhysa 2021 年 6 月 2 日
okay ty for the feedback, what would you reccomand for point (II)?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by