how to write it in compact form avoiding repetition
MATLAB: How can i write this statement labels=[1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;3;]; in compress form
arraysmatrices
Related Question
- How to generate the matrix [1 1; 1 2; 1 3 ; 2 1; 2 2; 2 3; 3 1 ; 3 2 ; 3 3] without loops
- How to make a colum of multiple 1 to 5. i want to make column vector of [1;1;1;1;1;1;1;1;1;1;1;1;1;1;2;2;2;2;2;2;2;2;2;2;2;2;2;2;3;3;3;3;3;3;3;3;3;3;3;3;3]. is there any way to make this kind of vector instead of typing this many times.
- Given a=[1 2 3 4 5], generate m=[2 1 3 4 5; 2 3 1 4 5; 2 3 4 1 5; 2 3 4 5 1; 1 3 2 4 5; 1 3 4 2 5; 1 3 4 5 2; 1 2 4 3 5; 1 2 4 5 3; 1 2 3 5 4].
- How to multiply a vector 3 times to get a 3 dimentional matrix
Best Answer