Write a function drawBox which draws boxes on the screen
Ältere Kommentare anzeigen
Write a function drawBox which draws boxes on the screen. The function is called with a character (ch) as the first argument and two positive integers which represent the width and the height of the box to be drawn. It automatically draws a box with the character (ch) by the specified width and height.
for example : drawbox('A';10;6)
11 Kommentare
rim
am 2 Dez. 2016
Geoff Hayes
am 2 Dez. 2016
asiya - this seems like a homework question, so please describe (or show) what you have attempted so far.
rim
am 2 Dez. 2016
Adam
am 2 Dez. 2016
You haven't shown us a function drawBox or told us what the error is. How exactly are you expecting us to help with these little bits of information missing?!
rim
am 2 Dez. 2016
rim
am 2 Dez. 2016
rim
am 2 Dez. 2016
Adam
am 2 Dez. 2016
Well you don't appear to have tried anything for yourself, which is the purpose of homework.
rim
am 2 Dez. 2016
Adam
am 2 Dez. 2016
['A' repmat( ' ', [1 8] ) 'A']
can produce one of the central lines. The top and bottom lines are even simpler. Then you just have to work out how to put it on the screen and use the input arguments rather than hard-coding numbers in.
rim
am 2 Dez. 2016
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
