I want set a threshold minimum of matrix

3 views (last 30 days)
Farung Samklang
Farung Samklang on 27 Jan 2021
Commented: Matt J on 27 Jan 2021
I have problem write code for set minimum matrix
assume i have,
A=rand(2,10)
B= rand(10,1)
C=A*B
then set minimum of matrix is min = 1;
I want random until elements of C are both row and column to have value than more min = 1.

Answers (1)

Matt J
Matt J on 27 Jan 2021
C=max(A*B,1)
  3 Comments
Farung Samklang
Farung Samklang on 27 Jan 2021
I run code, values less than 1 will be replaced by 1.
There any way to make new random values of C until they are greater than 1.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!