index exceed matrix dimension error
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Zhang lu
2013-5-3
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));'
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!