Intergrating the data using a scalar value

2 vues (au cours des 30 derniers jours)
Vishnuvardhan Naidu Tanga
Vishnuvardhan Naidu Tanga le 12 Oct 2021
Commenté : Mathieu NOE le 12 Oct 2021
Hello,
I am trying to do integration of a excel data. When I try to do that I am getting an error as follows:
Error using cumtrapz (line 51)
Dimension argument must be a positive integer scalar within indexing range.
Please can someone help me in solving that .
My code:
X1 = xlsread('Abb76at104.xlsx','A1:A63');
Y1 = xlsread('Abb76at104.xlsx','B1:B63');
V = 40.020;
A1 = pi*(X1).^2;
Q1 = A1.*Y1;
Int1 = cumtrapz(A1, V);
X2 = xlsread('Abb76at104.xlsx','A64:A130');
Y2 = xlsread('Abb76at104.xlsx','B64:B130');
A2 = pi*(X2).^2;
Q2 = (A2).*40.02;
Int2 = cumtrapz(A2, V);
Thanks in advance.

Réponse acceptée

Mathieu NOE
Mathieu NOE le 12 Oct 2021
hello
see the doc for cumtrapz
I believe you simply put the arguments in the wrong order
it must be
Int1 = cumtrapz(V,A1);
and
Int2 = cumtrapz(V,A2);
  8 commentaires
Vishnuvardhan Naidu Tanga
Vishnuvardhan Naidu Tanga le 12 Oct 2021
Thank you once again for sorting the thing out. Have a nice day.
Mathieu NOE
Mathieu NOE le 12 Oct 2021
my pleasure (again) !

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by