필터 지우기
필터 지우기

How can I make a sigma sum graph?

조회 수: 1 (최근 30일)
Han
Han 2019년 7월 3일
답변: Jyotsna Talluri 2019년 7월 24일
For example there are following graph for "x" and "q".
fun = @(x) x;
pb = 1:500;
a1 = length(pb);
q = zeros(1,a1);
for a = 1:a1
q(a) = -integral(fun,500,pb(a));
end
I want to replace the integral to a sigma sum for some steps.
I'd like to use a way of adding values as pb is closer to zero.
How can I do?
  댓글 수: 1
Akira Agata
Akira Agata 2019년 7월 4일
You mean, you would like to calculate the following equation for x = 1 ~ 500, and plot the result ?

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

답변 (1개)

Jyotsna Talluri
Jyotsna Talluri 2019년 7월 24일
Hi,
As the integral and summation are two different functions,we can't get the exact same results with the both.As the lower limit of integration is closer to zero both produce comparable results that don't differ much.For sigma sum you can use symsum function.
syms x;
f=x;
q(a)=symsum(f,x,pb(a),500);

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by