Answers is not a homework service, so I will not do your homework for you. However, this question is one that I would argue is confusing or perhaps misleading - because it tries to make you think along the lines of sparse matrices, when no sparse matrix will be constructed. So, what is being requested?
- Can you construct an nxm matrix that contains entirely a specific element? I.e., what is the default element? I hope you can do so by now. Is that not what you are told to do by the first two arguments?
- Can you then replace specific elements of that matrix? Even if a simple loop is required, there is no reason why this is not simple to do. (You might need to know how to use varargin, since there are an unspecified number of input arguments here.)
So what is the problem? Is that not all you were told to do? Could you have done this in a more efficient way than a loop? Well, yes, by a judicious use of cell2mat and sub2ind. In fact, you could have used sparse itself, or you could use accumarray. Are those vectorized alternatives pertinent? No.
When you are given a question, look at what is required. Try to ignore the extraneous information that serves only to mislead you. This is a classicly important part of any problem solving effort.