필터 지우기
필터 지우기

How to change values of specific elements inside a matrix?

조회 수: 1 (최근 30일)
darkgod89
darkgod89 2016년 6월 6일
편집: Azzi Abdelmalek 2016년 6월 6일
I have a 10x10 matrix y. I want to look for all the elements inside y that have a value greater than 100 and divide them by 10. How do I go about this? I was thinking of this if y > 100 y = y./10; end But it doesn't work for someone reason. How can I fix this? Or are there any alternate solutions?

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 6월 6일
편집: Azzi Abdelmalek 2016년 6월 6일
idx=y>100
y(idx)=y(idx)/10

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Array Geometries and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by