필터 지우기
필터 지우기

function fnint with a spline

조회 수: 1 (최근 30일)
Luis
Luis 2013년 4월 20일
편집: Aditya 2024년 1월 31일
Hello!
I would like to comment on something strange.
When running
outerFD=spline(thetavec,FetaC);
indefintegralFD = fnint(outerFD);
FD = fnval(indefintegralFD, thetamax) - fnval( indefintegralFD, thetamin);
in matlab 7.5 there is no problem. But when running the same in matlab 7.10 I get
"Undefined function or method fnint for input arguments of type 'struct'"
Does anyone have an explanation? Why fnint accepts a spline sometimes?
Thank you very much, Luis.

답변 (1개)

Aditya
Aditya 2024년 1월 31일
편집: Aditya 2024년 1월 31일
The error message you're encountering in MATLAB 7.10 suggests that the `fnint` function does not recognize the input argument as valid. The `fnint` function is used to compute the indefinite integral of a spline function, and it typically expects a spline structure as input.
The difference in behavior between MATLAB 7.5 (R2007b) and MATLAB 7.10 (R2010a) could be due to changes or updates in the MATLAB Spline Toolbox between these versions. It's possible that the internal representation of spline objects changed, or that there were updates to the `fnint` function that affect its compatibility with certain inputs.
Here's what you can do to troubleshoot and potentially resolve the issue:
1. Check the Spline Toolbox Version: Make sure that the Spline Toolbox is installed and check if there were any changes to the `fnint` function or to spline representations between the two MATLAB versions.
2. Verify the Input Type: Ensure that `outerFD` is a valid spline structure. You can check the type of `outerFD` by using the `whos` command.
whos('outerFD')
If `outerFD` is not a struct, you'll need to investigate why the output of `spline` is different in the two MATLAB versions.
3. Update Your Code: If there were changes to the `fnint` function, you might need to update your code to be compatible with the newer MATLAB version. Sometimes, using an alternative function or adjusting the way you call the function can resolve such issues.
4. Alternative Approach: As a workaround, you might consider using numerical integration methods available in MATLAB, such as `trapz` or `integral`, if you cannot get `fnint` to work with your spline structure in MATLAB 7.10.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by