Undefined function 'int' for input arguments of type 'double'.

1 回表示 (過去 30 日間)
Mathew Lindley
Mathew Lindley 2018 年 1 月 22 日
コメント済み: Mathew Lindley 2018 年 1 月 28 日
I am trying to integrate a function of propulsive power (positive values only) with respect to time to give energy. The propulsive power is in the form of a 10321x1 double matrix. The time is to range between 0 and 1032.1 seconds. The code I am inputting is as follows:
E = integral(Px_Pos,0,1032.1)
I am greeted with the error: Undefined function 'int' for input arguments of type 'double'. Can someone please help me?
I am new to MatLab and so my apologies if this is a trivial question.

採用された回答

Torsten
Torsten 2018 年 1 月 22 日
Use "trapz" instead of "integral".
Best wishes
Torsten.
  3 件のコメント
Torsten
Torsten 2018 年 1 月 23 日
Put your times in a 10321x1 vector T as well as the propulsive power in a 10321x1 vector P.
Then call "trapz" as
I = trapz(T,P).
Best wishes
Torsten.
Mathew Lindley
Mathew Lindley 2018 年 1 月 28 日
Torsten,
Many thanks for your help, this has worked.
Kind regards, Matt

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by