how delete the '-' in front of numbers in a matrix?

조회 수: 1 (최근 30일)
elisa ewin
elisa ewin 2016년 5월 24일
편집: Guillaume 2016년 5월 24일
Hi, I have this matrix
A=[2010 -10 -19 23;2010 -10 -18 22;2010 -10 -17 23;2010 -10 -17 19];
how can delete the '-' in front of the numbers?

채택된 답변

the cyclist
the cyclist 2016년 5월 24일
You mean you want to change all the negative numbers to positive numbers?
A = abs(A)
  댓글 수: 1
Guillaume
Guillaume 2016년 5월 24일
편집: Guillaume 2016년 5월 24일
The numbers look suspiciously like dates, so it's possible that the negative numbers are simply the result of bad parsing of the original string. While fixing the problem post-parsing is certainly valid, it's probably better in the long term to fix the parsing instead.
But that's worthy of another question by the OP.

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

추가 답변 (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