How to create a dataset in matlab with random values except for a specific area? -


i have attached sample image explains requirement.

i have 16x16 matrix or random values (1-1000) generated randi(1000, 16, 16)

now add 4x4 matrix of same number (eg. 80) somewhere in 16x16 matrix.

how make large numbers (1-1000) deviate new block of 80s values near 4x4 bock have values closer 80? enter image description here

ps. 500 near small matrix should have been ~100 (my mistake)

you can apply weighted average.

  • take random number x , take 80.
  • if in small matrix, weight of 80 1 , weight of x 0.
  • the further small matrix, smaller weight of 80 , larger weight of x.

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -