I want to extract the coefficient of P in fractional form equal to or more than 5 decimal points

2 ビュー (過去 30 日間)
c
clear all
clc
syms s
a=-0.01;
wn=3.06309;
k1=0.5;
k2=-1;
td=0.1;
wf=3.43;
zf=0.175;
P = (s^2+a*s+wn^2)*(s^2+2*zf*wf*s+wf^2);
coeffs(P)
now from the program i want to extract the coefficient of P in fractional form equal to or more than 5 decimal points the output is like
[ 17491108526356076144474795390179/158456325028528675187087900672, 12549355434302586327/1125899906842624000, 37181815892978056717/1759218604441600000, 2381/2000, 1 ]. Now how to get the coefficients in fractional form??
  2 件のコメント
vidhathri bhat
vidhathri bhat 2019 年 7 月 10 日
cast the output of coeffs(P) to double
double(coeffs(P))
Walter Roberson
Walter Roberson 2019 年 7 月 13 日
Joy Mondal comments to vidhathri bhat
its working thanks

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by