How to integrate using the for loop?
조회 수: 2 (최근 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에서 Particle & Nuclear Physics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!