Info

此问题已关闭。 请重新打开它进行编辑或回答。

Hi, I am trying to read a text file and perform operations on it, but having a hard time with the integral

1 次查看(过去 30 天)
%importing and reading text file
fid = fopen('A9P3data-S19.txt');
mat = fscanf(fid, '%f ', [3,inf]);
%assigning values for variables from file obtained
w = mat(1,1);
day = mat(2,1:13);
h = mat(3,1:13);
v = mat(1,2:14);
%calculating instantanious volumetric flow rate
Q = 0.85*v.*w.*h;
%calculating total amount of water flowed in 1 year period
V = 86400*integral(Q,1,366);
-----------------------------------------------------------------Data File---------------------------------------------------------------
4
1 3.0 5.4
32 4.2 7.3
60 4.8 8.6
91 6.5 9.7
121 8.2 12.5
152 8.8 13.2
182 9.8 13.5
213 8.1 11.9
244 6.2 9.5
274 5.4 9.1
305 4.5 7.5
335 3.1 5.6
366 2.9 4.3
I know i need a function handle for the integral, but i dont know which one and where to place it.

回答(0 个)

此问题已关闭。

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by