How to tell if c++ S-function is being linearized?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have a non-linear c++ s-function in which I need to perform additional calculations to update various parameters that are not persistent during linear analysis runs to obtain an accurate result. This s-function is being linearized by MATLAB's numerical perturbation methods. In the time domain I do not need to perform these calculations again. Is there a flag or parameter somewhere that can be read by an s-function which shows if the current model is being linearized?
Currently I've hobbled together the s-function reading a variable I'm setting in my workspace for linear analysis runs, but this isn't an ideal solution to maintain portability across different applications.
I am running on r2014b.
Thanks, Seth
EDIT: For now I've decided to look through MATLAB's dbstack and look for the 'linearize' function somewhere in that stack. This does not seem ideal but works for the time being.
3 件のコメント
Alain Kuchta
2017 年 5 月 16 日
Hi Seth,
Thanks for providing a detailed description. I think using a block parameter to indicate when the block should behave in normal mode vs. linearization mode is the best solution available. I'm not aware of any way to detect that a block is being executed as part of linearization of a model.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Aerospace Applications についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!