Intergrating the data using a scalar value

12 visualizaciones (últimos 30 días)
Vishnuvardhan Naidu Tanga
Vishnuvardhan Naidu Tanga el 12 de Oct. de 2021
Comentada: Mathieu NOE el 12 de Oct. de 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.

Respuesta aceptada

Mathieu NOE
Mathieu NOE el 12 de Oct. de 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 comentarios
Vishnuvardhan Naidu Tanga
Vishnuvardhan Naidu Tanga el 12 de Oct. de 2021
Thank you once again for sorting the thing out. Have a nice day.
Mathieu NOE
Mathieu NOE el 12 de Oct. de 2021
my pleasure (again) !

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Numerical Integration and Differentiation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by