how can fix this problem with matrix ?
7 次查看(过去 30 天)
显示 更早的评论
How can I create matrix with the size N,m?
How can I copy each array of matrix in a vector and make the modification in it
and the replace again in the matrix?
Example
vector = M (1,:)
after modification of the vector
M(1,:) = vector
But an error appear " Index exceeds matrix dimensions."
4 个评论
Adam Danz
2019-10-30
vector = M (1,:)
% Somewhere between these two lines your vector is changing in one
% of the following 2 ways:
% 1) it's length is changing
% 2) it is converted to a column vector instead of a row vector
% 3) an additional row is added to the vector making it a matrix
M(1,:) = vector
回答(1 个)
Sai Bhargav Avula
2019-10-30
Hi, May be after modification you vector became a column vector. Try
M(1,:) = vector';
If this doesn't work, provide the value of size(vector).
Hope this helps!
0 个评论
另请参阅
类别
在 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!