function fnint with a spline

7 visualizzazioni (ultimi 30 giorni)
Luis
Luis il 20 Apr 2013
Modificato: Aditya il 31 Gen 2024
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.

Risposte (1)

Aditya
Aditya il 31 Gen 2024
Modificato: Aditya il 31 Gen 2024
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.

Categorie

Scopri di più su Spline Postprocessing in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by