필터 지우기
필터 지우기

I have 200 by 4 matrix represents thicknesses and need to calculate the corresponding depths (will be also 200 by 4 matrix)

조회 수: 3 (최근 30일)
the rows represents the thicknesses and columns represents wells (boreholes).
assuming thicknesses h1, h2, h3, and h4 in first row in thicknesses matrix
then the depths sholuld be z1= h1, z2 = h1+h2, z3 = h1+h2+h3, and z4 = h1+h2+h3+h4 in first row in depth matrix
thanks in advance

채택된 답변

Voss
Voss 2022년 4월 9일
% a random 10-by-4 matrix of thicknesses
% each element between 1 and 15:
h = randi(15,10,4)
h = 10×4
1 15 13 11 14 10 9 5 7 3 1 5 12 12 4 11 2 12 14 14 14 14 10 7 9 15 3 5 7 15 7 12 7 1 4 9 3 8 8 7
% depth is cumulative sum along rows of h:
z = cumsum(h,2)
z = 10×4
1 16 29 40 14 24 33 38 7 10 11 16 12 24 28 39 2 14 28 42 14 28 38 45 9 24 27 32 7 22 29 41 7 8 12 21 3 11 19 26
  댓글 수: 4

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by