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 日間)
ragheed idrees
ragheed idrees 2019 年 6 月 6 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
%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