T
T
Tarakkolya2014-12-06 19:24:30
MATLAB
Tarakkolya, 2014-12-06 19:24:30

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

1 answer(s)
D
Daniil Smirnov, 2015-04-01
@antonsosnitzkij

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 question

Ask a Question

731 491 924 answers to any question