How to integrate using the for loop?
1 回表示 (過去 30 日間)
古いコメントを表示
I have a cosine wave function. how can I integarte that using the for loop. The cosine wave is an array of 1x40019. How can i integarte that one?
0 件のコメント
回答 (1 件)
Star Strider
2022 年 10 月 28 日
No loop necessary —
LD = load(websave('V1','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1172553/V1.mat'));
V1 = LD.V1;
x = 0:numel(V1)-1;
V1int = cumtrapz(x,V1);
figure
yyaxis left
plot(x,V1)
ylabel('V_1')
yyaxis right
plot(x,V1int)
ylabel('V_1 Integrated')
.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!