Info

この質問は閉じられています。 編集または回答するには再度開いてください。

how to pass varibles from main code to other function with out using gloval varible or input arguemnts ?

1 回表示 (過去 30 日間)
tomer polsky
tomer polsky 2018 年 1 月 10 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
hello I need to use in my code command that called ode 45 ,how ever i have main code and it this main code i write all my data and i cant transfer this data to the ode function with out makeing it global (i dont want to use gloval varibles becouse it is bad progrmaing ) , how ever i also cant use this data as input arguments of this ode fucntion , what do i do ? i treid using Persistent variables but i it also did not helped me , what to do ?
  2 件のコメント
Adam
Adam 2018 年 1 月 10 日
Why can't you use input arguments? They are the natural way of passing data to functions.
Persistent variables have very specific use cases, but don't go near them otherwise. In the right circumstances they are very useful, in all other circumstances they are as disastrous as global variables and the vast majority of coding falls into the 'all other circumstances' category.
tomer polsky
tomer polsky 2018 年 1 月 10 日
because it is giving me an error ,apparently you cant use other input parameters expect x and t to use the ode command

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by