Format output with constant display values
2 ビュー (過去 30 日間)
古いコメントを表示
Hello, how would I format this code so that it has an output display of
(2*pi*X2)/period
Where the displayed output is not simplified and the denominator is always period (60) and the numerator is always displayed as 2*pi*_.
Basically I want the format to be the same but only the X2 value to change, no simplification.
fs = 5400;
T = 1/fs;
n = 0:959; %sample 960
t = n * T;
xn = cos(540*pi*t) + cos(3600*pi*t) + cos(5040*pi*t);
A = sym([(540*pi)/5400, (3600*pi)/5400, (5040*pi)/5400]);
X = gcd(A);
X2 = A ./ X
[n, d] = numden(X);
n = n * 2;
d = d * 2;
num = X2 * n;
den = [d d d];
period = d; %60
pretty((2*pi*X2)/period);
0 件のコメント
回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Fourier Analysis and Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!