필터 지우기
필터 지우기

change dimension matrix

조회 수: 2 (최근 30일)
Fiboehh
Fiboehh 2011년 5월 9일
Hellow, i have problems to solve this two little things with matrices: to make from p(N,M) a vector p(N*M) for example p = [1 3 ; 2 5 ; 3 5 ; 4 2] so with dimension p(rot,nd) where rot=4 and nd=2. Now i want to make with his matrix a new one witch is: p = [ 1 ; 3; 2; 5; 3; 5; 4; 2 ] so the new dimension must be p(N) where N=rotations*nd=8
Second is to divide all the elements by the same number. For matrix p(N) For example 2 so the matrix is in the same dimension p(N) but all the elements are divided threw 2. So p must become= p[0.5; 1.5; 1; 2.5; 1.5; 2.5; 2 ;1]

채택된 답변

RoJo
RoJo 2011년 5월 9일
I think this will do what you are looking for
q = reshape(p', size(p, 1) * size(p, 2), 1) ./ 2

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by