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
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!