フィルターのクリア

how to make the matlab code to test the equation below convergent or divergent?

11 ビュー (過去 30 日間)
Muhammad Rohim
Muhammad Rohim 2020 年 4 月 21 日
コメント済み: Ameer Hamza 2020 年 4 月 21 日
below is the matlab code that I used to solve it. but more code is needed to display the convergent or divergent equation above.
function [ Sum_n, series_1 ] = Coba5( n, es )
%Percobaan 3
clc;
clear;
n = input ('nilai signifikan: ');
series_1 = 0
es = 0.5*(10^(2-n));
for ns = 1:100
x = cumsum( sin(2*ns)./ns.^2)
series_1 = series_1 + x
end
disp([es]')
end

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 4 月 21 日
Just find the sum and check if it is convergent or divergent
syms n
term = sin(2*n)/n^2;
y = vpa(symsum(term, n, 1, inf));
if isinf(y)
fprintf('divergent\n');
else
fprintf('convergent\n');
end
  4 件のコメント
Muhammad Rohim
Muhammad Rohim 2020 年 4 月 21 日
thank you very much.
Ameer Hamza
Ameer Hamza 2020 年 4 月 21 日
Glad to be of help.

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

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

製品


リリース

R2013a

Community Treasure Hunt

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

Start Hunting!

Translated by