Intergrating the data using a scalar value

10 Ansichten (letzte 30 Tage)
Vishnuvardhan Naidu Tanga
Vishnuvardhan Naidu Tanga am 12 Okt. 2021
Kommentiert: Mathieu NOE am 12 Okt. 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.

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by