i have a table
3 10 1
2 6 2
3 10 1
4 3 3
5 9 4
2 6 2
1 9 5
11 1 6
2 6 2
1 9 5
and i have an array in which position is given to break the table from that part
X=[2,4,6,7]
how can i do this such that i get all the tables in output
thank you in advance

 채택된 답변

madhan ravi
madhan ravi 2019년 8월 12일

0 개 추천

ix = diff([0,X,size(x,1)]); % x your table
Wanted = mat2cell(x,ix)

댓글 수: 3

If you want to stop at the 7th position then:
ix = diff([0,X]);
Wanted = mat2cell(x(1:sum(ix),:),ix)
PRAVEEN GUPTA
PRAVEEN GUPTA 2019년 8월 12일
but how will i get the output i.e. 4 different tables
madhan ravi
madhan ravi 2019년 8월 13일
Each cell contains table.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

질문:

2019년 8월 12일

댓글:

2019년 8월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by