how to round up and down?

3 views (last 30 days)
Kobi
Kobi on 7 Aug 2014
Commented: Azzi Abdelmalek on 7 Aug 2014
i have the folowing matrix
ans =
0 0 0 0 -0.2500
0 0 0 0.7500 0
0 0 -0.2500 0 0
0 0.7500 0 0 0
-0.2500 0 0 0 0
i need to round it so the diognal elements are -1 1 -1 1 -1 how can i do this?

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 7 Aug 2014
sign(A).*ceil(abs(A))

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!