필터 지우기
필터 지우기

reshape matrix

조회 수: 1 (최근 30일)
itsik
itsik 2011년 5월 27일
i have this matrix 00001110000 00001110000 00001110000 and i want to make it like that
11100000000
11100000000
11100000000
how to do that?
thanks!

채택된 답변

Oleg Komarov
Oleg Komarov 2011년 5월 27일
Note that the way you indicated your input it looks like a char array. I inferred from your duplicate post that it is a double matrix (you should separate elements)
A = [0 0 0 0 1 1 1 0 0 0 0
0 0 0 0 1 1 1 0 0 0 0
0 0 0 0 1 1 1 0 0 0 0];
Two solutions:
A(:,[5:end 1:4])
or
circshift(A,[1 -4])

추가 답변 (2개)

itsik
itsik 2011년 5월 27일
this is the first matrix
00001110000
00001110000
00001110000
  댓글 수: 1
Oleg Komarov
Oleg Komarov 2011년 5월 27일
Please edit your original post, don't add answers.

댓글을 달려면 로그인하십시오.


itsik
itsik 2011년 5월 27일

thank u so much my friend and i have another question how do i filter all the zeros so i can get only

A=   111
     111
     111

thank u so much!

  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 5월 27일
A(:,any(A))

댓글을 달려면 로그인하십시오.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by