![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/256759/image.png)
average value of a half wave rectified sine curve
9 ビュー (過去 30 日間)
古いコメントを表示
I have a half wave rectified sine wave. I want to calculate the average of this curve on matlab and plot it. Please help.
f = @(t) sin(t).*(sin(t)>=0) + 0*(sin(t)<0);
t = linspace(0, 4*pi);
plot(t, f(t))
0 件のコメント
採用された回答
Star Strider
2019 年 12 月 22 日
This is straightforward:
syms f t t0 t1
halfwave(f,t0,t1) = int(sin(2*pi*f*t), t, t0, t1/2)/(t1 - t0)
numericvpa = vpa(halfwave(1,0,1))
producing:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/256759/image.png)
Note that the Root-Mean-Square value:
RMS = sqrt(mean(f(t).^2))
is more meaningful, since that is the D-C equivalent.
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!