Filter löschen
Filter löschen

Crank-Nicolson finite difference method - Error: Function definitions are not permitted in this context.

1 Ansicht (letzte 30 Tage)
ive copied the codes for Crank-Nicolson finite difference method, but it wont run and keeps showing this error msg 'Error: Function definitions are not permitted in this context.', any idea to fix this? thx guys :)
*function oPrice = finDiffCN(X,S0,r,sig,Svec,tvec,oType)
|
Error: Function definitions are not permitted in this context.*
ooo and one more thing, if it says - undefined function 'finDiffCN' for input arguments of type 'double'- how to fix it? thx!

Antworten (1)

Titus Edelhofer
Titus Edelhofer am 16 Jun. 2015
You need to save the code to a file, then call it ...
Titus
  1 Kommentar
Romenimo Carlos Cutana
Romenimo Carlos Cutana am 29 Mär. 2022
Greetings. I hope you a doing great. I am facing a problem with the same code, it say that: not enough input arguments.
I don't know if you can help me.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by