필터 지우기
필터 지우기

How to divide different rows of a matrix to different numbers?

조회 수: 1 (최근 30일)
Mnr
Mnr 2014년 3월 29일
댓글: Mnr 2014년 3월 29일
Hello all,
I have a mx2 matrix with its different rows are different integer multiples of (1,0), (-1,0), (0,1), (0,-1), (1,1), (-1,1), (1,-1). For example, my matrix can be something like: [4 4; 0 3; 2 0; -5 5.....]
I would like to divide each row by a proper integer such that I can extract (1,0), (-1,0), (0,1), (0,-1), (1,1), (-1,1), (1,-1). Can anybody help me please? Thanks.
  댓글 수: 1
Azzi Abdelmalek
Azzi Abdelmalek 2014년 3월 29일
To make your question clear, post a short example with the expected result

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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 3월 29일
편집: Azzi Abdelmalek 2014년 3월 29일
Maybe you want
A=[4 4; 0 3; 2 0; -5 5]
out=sign(A)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by