Index out of bounds
2 次查看(过去 30 天)
显示 更早的评论
Hi guys,
I need your help once more!
The error is: index out of bounds because size(z)=[22719,1];
So this is my code where things go wrong:
X = [ones(M,1), z(:,t) z(:,t).^2];
and this is the error:
Attempted to access z(:,19); index out of bounds because size(z)=[22719,1].
Any help would be appreciated.
Thanks!
0 个评论
采纳的回答
Azzi Abdelmalek
2013-5-30
The problem is clear
The size of z is [22719,1], which means z(:, 19) does not exist
2 个评论
Azzi Abdelmalek
2013-5-30
编辑:Azzi Abdelmalek
2013-5-30
Maybe this is what you want, but I'm not sure, you have to tell us.
X = [ones(M,1);z(t,1) ;z(t,1).^2];
更多回答(1 个)
另请参阅
类别
在 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!