error using trapz

12 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2018 年 4 月 25 日
回答済み: MathWorks Support Team 2018 年 4 月 25 日
I am using the "trapz" function and keep getting the error:
Error using trapz (line 66)
Point spacing must be a scalar specifying uniform spacing or a vector of x-coordinates for each data point.

採用された回答

MathWorks Support Team
MathWorks Support Team 2018 年 4 月 25 日
This error is indicating that the first input, X, into "trapz" is not the proper size.
The X input must be a uniform scalar spacing, or a vector of coordinates.
- If X is a scalar, then it specifies a uniform spacing between the data points and trapz(X,Y) is equivalent to X*trapz(Y).
- If X is a vector, then it specifies x-coordinates for the data points and length(X) must be the same as the size of the integration dimension in Y.
For more information on these inputs, see the following documentation page:
You can check your variables to ensure they are as expected by using the debugger. The following link explains how you can use the debugger to find the issue:

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by