how can fix this problem with matrix ?
Mostrar comentarios más antiguos
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 comentarios
Ted Shultz
el 28 de Oct. de 2019
Can you show more of your code. What is in matrix M? is it empty?
Adam Danz
el 28 de Oct. de 2019
"But an error appear " Index exceeds matrix dimensions.""
If you intend to modify a single column of a matrix, you cannot change the number of rows. You can replace some of the existing values with NaN or missing but it must maintain its shape and size if it remains as part of the matrix.
Mira le
el 30 de Oct. de 2019
Adam Danz
el 30 de Oct. de 2019
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
Respuestas (1)
Sai Bhargav Avula
el 30 de Oct. de 2019
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!
Categorías
Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!