Solve an definite integral with variable constants

조회 수: 4 (최근 30일)
Kyle Langford
Kyle Langford 2022년 2월 4일
댓글: Kyle Langford 2022년 2월 4일
I don't know why I am having such a hard time with this.
I am trying to solve a definite integral with additional constant variables, but MATLAB doesn't want to compute it.
I want to do something along these lines, and have my final answer involve 'n'.
clear;clc;
syms t n
T=2*pi
A_0=@(t) 1/2*pi
A_n(t)=@(t) (2/T)*cos(n*t)
B_n(t)= (2/T)*sin(n*t)
A0=integral(A_0,-pi,pi)
An=integral(A_n,-pi,pi)
Bn=integral(B_n,-pi,pi)

채택된 답변

Walter Roberson
Walter Roberson 2022년 2월 4일
syms t n
Pi = sym(pi)
Pi = 
π
T=2*Pi
T = 
A_0(t) = 1/2*Pi
A_0(t) = 
A_n(t) = (2/T)*cos(n*t)
A_n(t) = 
B_n(t) = (2/T)*sin(n*t)
B_n(t) = 
A0 = int(A_0, t, -Pi, Pi)
A0 = 
An = int(A_n, t, -Pi, Pi)
An = 
Bn = int(B_n, t, -Pi, Pi)
Bn = 
0

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by