index exceed matrix dimension error

Hi, I have a matrix of 13x15 double. I want to do randomization by using the coding below to discard 1st coefficient of the data.
The coding: Random_new_data = newdata(2:end, randperm(30));% column 2 to 13
However I got the "index exceed Matrix dimension error"
May I know what is the possible problem in the data? Thanks a lot.

답변 (1개)

Zhang lu
Zhang lu 2013년 5월 3일

0 개 추천

randperm(30) produces a vector ,including 1 to 30.
But your matrix's column is 15 .
So,it is possible that 'Random_new_data = newdata(2:end, randperm(15));'

댓글 수: 2

Hamzah amee
Hamzah amee 2013년 5월 3일
Thanks a lot Zhang Lu.
This really help me! God Bless you.
José-Luis
José-Luis 2013년 5월 3일
Please accept an answer if it helped you.

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

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

질문:

2013년 5월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by