How can I choose a set of columns from my table. I have to get the means of let's say columns 1 and 5, columns 2 and 6 etc from 20 columns. Thanks
조회 수: 2 (최근 30일)
이전 댓글 표시
Does this look like a correct line of code? x = mean(w(:,[1:4:10 11:4:20]));
댓글 수: 0
채택된 답변
Sadik
2017년 5월 26일
Looks correct. Means of columns 1 and 5, for instance, would look like this:
x = mean(w(:,[1 5]))
Best.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!