error message undefined function or variable ‘integral’ .

Dear all ,i made numerical integration in script bit i get error message : undefined function or variable ‘integral’ .

 採用された回答

madhan ravi
madhan ravi 2018 年 11 月 9 日
編集済み: madhan ravi 2018 年 11 月 9 日

0 投票

It’s integral not 'integral' no strings around

4 件のコメント

Mohamad
Mohamad 2018 年 11 月 9 日
編集済み: madhan ravi 2018 年 11 月 9 日
The code given below , when I run it i get the message :
Undefined function or variable 'integral'.
% FS for triangle periodic triangle function
% Compelx exponential FS
clc
clear;
a=-1
b=1
T0=b-a
N=11
F0=1/T0
wi=[-N:N]*2*pi/T0;
t=(a:0.2:b)';
D=zeros(2*N+1,1);
xt=my_tri(t);
fun1 = @(t)my_tri(t);
q1 = integral(fun1, a,b);
D(N+1)=q1/T0;
madhan ravi
madhan ravi 2018 年 11 月 9 日
編集済み: madhan ravi 2018 年 11 月 9 日
I suspect that integral is available only from 2012a which version are you using?
so try
q1 = quad(fun1, a,b);
might work
Mohamad
Mohamad 2018 年 11 月 26 日
Ok , thanks a lot , the problem solved
madhan ravi
madhan ravi 2018 年 11 月 26 日
Anytime :)

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

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2018 年 11 月 9 日

コメント済み:

2018 年 11 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by