Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
Mnr
Mnr am 29 Mär. 2014
Kommentiert: Mnr am 29 Mär. 2014
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.

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 29 Mär. 2014
Bearbeitet: Azzi Abdelmalek am 29 Mär. 2014
Maybe you want
A=[4 4; 0 3; 2 0; -5 5]
out=sign(A)

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by