Write a function that will take two numbers as input arguments and will print a set of concentric squares of stars whenever the row and column are odd.
Show older comments
Provide Answer
5 Comments
James Tursa
on 31 Oct 2016
Malik McMillon
on 31 Oct 2016
Image Analyst
on 31 Oct 2016
What row and what column? How does row and column relate to the 2 numbers you input? Are they the same, i.e., the two input numbers ARE the row and column?
What do you do if the row and column are not (both) odd? Just do nothing? Just do one square of stars but not two concentric ones? What if only one (either row pr column) is odd but the other is even? What do you do then?
There is just so much missing from the problem definition that I can't answer.
Malik McMillon
on 31 Oct 2016
Edited: Walter Roberson
on 31 Oct 2016
Walter Roberson
on 31 Oct 2016
What would be the expected output for
fnname( sqrt(2), pi-4i )
?
Accepted Answer
More Answers (1)
Walter Roberson
on 31 Oct 2016
0 votes
Starting points:
To add to this, you need to find out what the question means. Is it the row and column indices that might or might not be odd, or is it based upon the content of some array? How big should the squares be? What should be printed for the other locations? What do the two input numbers have to do with the rest of the question?
2 Comments
Malik McMillon
on 31 Oct 2016
Edited: Walter Roberson
on 31 Oct 2016
Walter Roberson
on 31 Oct 2016
The only question that answers is what the name of the function should be.
Categories
Find more on Programming 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!