i am writing a matlab m file.(adsbygoogle = window.adsbygoogle || []).push({});

i need to generate a NxN matrix 25% filled with 0s and 1s in a random pattern...

is this at all possible?

also, in an NxN matrix, i need to select a 3x3 matrix centered around a certain point, can you help me out with this?

many thanks for your help

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Matlab help!

**Physics Forums | Science Articles, Homework Help, Discussion**