RMS of Piecewise Function
古いコメントを表示
Hello Community,
i try to calculate the root mean square of a piecwise function.
I had different approaches, but all them don't work.
1. Approach
syms t
y = piecewise(0<=t<=2,-sin(2*pi/8*t));
rms = rms(y);
Error Message: Error using sym/subsindex (line 953)
Invalid indexing or function definition. Indexing must follow MATLAB indexing. Function arguments must be symbolic variables, and function body must be sym expression.
2. Approach
syms t
y = piecewise(0<=t<=2,-sin(2*pi/8*t));
t = 0:0.001:2;
z = subs(y);
m = double(z);
rms = rms(m);
Error Message: Array indices must be positive integers or logical values.
I don't know any other approach.
I hope, I expressed my problem appropriatly.
Thanks for your help!
Smitty
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
