Write a function drawBox which draws boxes on the screen

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

please help me with this question
asiya - this seems like a homework question, so please describe (or show) what you have attempted so far.
Im having error in function drawBox, its not working for me in any way
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?!
the output should b this
Well you don't appear to have tried anything for yourself, which is the purpose of homework.
it my first time studying Matlab and i cant understand it thats why i am asking i doest mean that i havent tried by my self.
['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.
ThankYou

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

rim
2016년 12월 2일

댓글:

rim
2016년 12월 2일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by