How do I input a different character into a matrix full of characters?
1 view (last 30 days)
Show older comments
Alec Gutmanstein
on 30 Jan 2016
Answered: the cyclist
on 31 Jan 2016
I have generated a matrix using the following code (width and height are user input):
field = ones(width,height) .* 'O';
field = char(field);
I need to put a letter different from 'O' at several points across only one row (say the top row).
0 Comments
Accepted Answer
the cyclist
on 31 Jan 2016
width = 4;
height = 5;
field = ones(width,height) .* 'O';
field = char(field);
field(1, [2 3 5]) = 'K'
0 Comments
More Answers (0)
See Also
Categories
Find more on Matrices and Arrays 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!