MatlabFunctionBlock内の計算、変数の桁数確保
Show older comments
MatlabFunctionブロックに以下の入力,A・B・vを入れます.
A = 0.03138 B = 4.903 v = 12.5
出力xを以下のよう記述しています. x = 1-v^2*A/B
この計算結果が0になってしまいます.Excel等で計算すると-2.54946*10^-5と微量の値を持っており,プログラムの中で桁落ちが起きていることまではわかりました.
しかし,どう処理させれば桁落ちが発生しないかがわかりません. vpa関数などはMatlabFunctionブロックでは使用できないようです.
また,これを利用していくつかの計算を行わせるため,できればMatlabFunctionブロックを使いたいです.
Accepted Answer
Categories
Find more on MATLAB Function Block Basics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!