Effacer les filtres
Effacer les filtres

How to integrate using the for loop?

3 vues (au cours des 30 derniers jours)
ANANTA BIJOY BHADRA
ANANTA BIJOY BHADRA le 28 Oct 2022
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?

Réponses (1)

Star Strider
Star Strider le 28 Oct 2022
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')
.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by