I have a large set of data that contains information about numerous different core samples. Each core sample has a different amount of sections, the amount of sections for each specific core is stipulated in column 13. I need to find out the length of each core sample, this information is provided in the final section length. So if the value in column 13 was 6, the length of the core would be found in column 19. As each core has different amount of sections how would I extract information regarding the length of each individual core?

 채택된 답변

Walter Roberson
Walter Roberson 2013년 10월 14일

0 개 추천

final_len_col = 13 + coredata(:,13);
final_len_idx = sub2idx(size(coredata), 1:size(coredata,1), final_len_col);
final_lengths = coredata(final_len_idx);
This can be abbreviated
final_lengths = coredata((1:size(coredata,1)).' + size(coredata,1) * ((13-1) + coredata(:,13)));

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

2013년 10월 14일

댓글:

2013년 10월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by