필터 지우기
필터 지우기

symsum with if statement or condition

조회 수: 2 (최근 30일)
Masood Abbasi
Masood Abbasi 2018년 4월 24일
댓글: Masood Abbasi 2018년 4월 24일
Hi S1 = symsum(k^2 + m, k, [1 10]) I want m to be 1 when k=3 and else 0. How can i put if statement inside symsum() function
  댓글 수: 2
Juri Maibaum
Juri Maibaum 2018년 4월 24일
편집: Juri Maibaum 2018년 4월 24일

As it is a sum and as k=3 is occurring exactly once, you can use

S1 = symsum(k^2,k,[1,10])+m;

Or do you actually look for a more general solution?

Masood Abbasi
Masood Abbasi 2018년 4월 24일

Thanks but this is simple equation how can i add to complex equations like

here i need to replace 'p' with 1 0r 0.7 based on some value of 'i' and 'd'. How can i add conditional statement here.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by