MatlabFunctionBlock内の計算、変数の桁数確保
Afficher commentaires plus anciens
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ブロックを使いたいです.
Réponse acceptée
Plus de réponses (1)
Catégories
En savoir plus sur MATLAB Function Block Basics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!