Creating a cross pattern in a 128 x 128 matrix in MATLAB
Show older comments
I am trying get get a head start on courses and I've run into a sample problem in my textbook about creating a 128 x 128 of zeros and then filling in a cross pattern of ones in the center of this matrix. I am trying to minimize use of forloops
I was thinking of concatenating matrices, but I am a MATLAB newbie it would also be annoying to designate which positions need to be filled and what not if I concatenate
I am wondering if there is a rectangle function that I can use to create a horizontal and vertical rectangle to make the cross pattern or any other suggestions
Also, is there a way to zoom out on the output....as it is very hard to check a 128 x 128 matrix??? (since the output is broken up into rows and columns)
Thank you very much
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!