Answer the question
In order to leave comments, you need to log in
How to make matrix elements vectors in Matlab?
Is it possible to somehow assign a vector to the elements of the matrix? That is, so that each element of the matrix is a vector.
Answer the question
In order to leave comments, you need to log in
yes
example:
x=[1 2 3 4; 5 6 7 8]; %matrix 2 rows 4 columns
y=[9 10 11 12]; %vector
x(1,:)=y; %set all elements of the first row to the value of the vector y
colon means "all elements"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question