Changing Global Variable
3 次查看(过去 30 天)
显示 更早的评论
I am simulating a fluidized bed system, in which I would like to pass two values calculated from ODE45 as input into other functions. Since the two calculated values of the ODE45 changes every time, I have to export the calculations into .mat file (and using -append to store the latest calculated values), and then read these values by using dlmread. But this is taking a long time, approx. 15 days.
Is there any methods for me to perform this task (i.e. share the two calculated values, without using global, and without using the passing argument)? Please help me as I am officially stuck for a week now.
Thank you.
0 个评论
回答(2 个)
Image Analyst
2012-2-20
Wow, I've never heard of dlmread taking 15 days. How big are the files? In fact I've never heard of anyone even using dlmread to read .mat file - I always hear of people using load() to read .mat files. Anyway, I'm not sure why you can't just pass in your arguments via the argument list. So what if they change every time? Usually arguments change every time - that's why functions are built. But you can use setappdata() and getappdata() if you want to, though I still don't know why that would be necessary. Or you can read the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.3F
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!