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.

조회 수: 1 (최근 30일)
Provide Answer
  댓글 수: 5

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

채택된 답변

James Tursa
James Tursa 2016년 10월 31일
Here is a starting point:
1) Create a function m-file in your working directory with an appropriate name. E.g.,
edit mycircles.m
2) Put this code into this file:
% Add a description of the function, inputs & outputs, here
function mycircles(a,b)
% Insert your code for printing the "squares of stars" here
end
Add your description and your code in the places indicated.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2016년 10월 31일
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?

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by