Gistlib Logo

gistlib

mw = hmdata(125:155,:); hr = hmdata(230:260,:); set these to vectors in matlab

To set the given matrices as vectors in MATLAB, you can use the (:) operator which reshapes the matrix into a column vector.

main.m
mw_vector = mw(:);
hr_vector = hr(:);
38 chars
3 lines

This will give you two column vectors mw_vector and hr_vector.

similar matlab code snippets

save ten vectors to matrix in matlab
how to call on a specific value in matlab
create a matrix of random 3-vectors that all have norm 1 in matlab
save ten vectotors 784x1 in martix 784x10 in matlab
how to change the diagonal of a matrix 3x3 with a vector with 3 elements in matlab
create a matrix of 3 vectors that all have norm 1 in matlab
create a matrix out of two vectors in matlab
given the matrix a = [ 1 -1 3; -1 2 5; 3 0 -4] and the vector b=[ 1; 0; -2], compute the column vector v storing the square of each element of the vector x in matlab
how to change the diagonal of a matrix 3x3 with a vector with 3 elements using a loop to create the vectorin matlab in matlab
how to calculate the left null space of a matrix in matlab

related categories

matrices
vectors
matlab

gistlibby LogSnag