Change sign of descending values

조회 수: 3 (최근 30일)
Morten Nielsen
Morten Nielsen 2019년 6월 27일
답변: James Tursa 2019년 6월 27일
How can i change the sign of decending values ?
4165
4230
4296
4361
4430
4476
4549
4604
4664
4705
4710
4714
4718
4718
4716
4713
4708
4697
4646
4572
4491
  댓글 수: 1
James Tursa
James Tursa 2019년 6월 27일
What is the exact desired output for your example?

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

채택된 답변

James Tursa
James Tursa 2019년 6월 27일
Is this what you want?
x = your vector of values
d = [1;diff(x)];
x(d<0) = -x(d<0);

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by