Anon function keeps giving error

I am trying to code an anon function, my code reads
My_Function =@(t,y)(AtheroEqn2016(t,y,e))
[t,y] = ode23t(@My_Function, tp, ic, options);
save('savedData');
clf;
Byt keep getting this error
Error: File: AP.m Line: 39 Column: 17 "My_Function" was previously used as a variable, conflicting with its use here as the name of a function or command.
Can anyone tell me where I am going wrong
Thanks

 採用された回答

Guillaume
Guillaume 2016 年 7 月 1 日

0 投票

My_Function is already a variable of type function handle, you do not need and must not convert it into a function handle. Thus:
[t,y] = ode23t(My_Function, timePeriod, initialConditions, options);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeTables についてさらに検索

質問済み:

2016 年 7 月 1 日

編集済み:

2016 年 7 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by