Reassigning values in a matrix

I have a matrix, and here's what I want to do with it -
1.) Find the max value of the matrix, assign it to be 1.
2) Find all the values in the matrix that are 80% of the max value, and assign it the value 0.8
3) Find all the values in the matrix that are 60% of the max and assign it the values of 0.6
How can I do this in matlab?

댓글 수: 1

madhan ravi
madhan ravi 2019년 9월 11일
Is it homework? What have you tried so far?

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

답변 (1개)

KSSV
KSSV 2019년 9월 11일

0 개 추천

Read about max toget the maximum value in the array.
Read about inequalitites >and < to get the other task solved.
Read about logical indexing.

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

2019년 9월 11일

답변:

2019년 9월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by