Reassigning values in a matrix

2 次查看(过去 30 天)
Native
Native 2019-9-11
回答: KSSV 2019-9-11
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 个)

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

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by