Statistics
All
Cody
0 Problems
9 Solutions
RANK
N/A
of 300,753
REPUTATION
N/A
CONTRIBUTIONS
0 Questions
0 Answers
ANSWER ACCEPTANCE
0.00%
VOTES RECEIVED
0
RANK
of 21,075
REPUTATION
N/A
AVERAGE RATING
0.00
CONTRIBUTIONS
0 Files
DOWNLOADS
0
ALL TIME DOWNLOADS
0
CONTRIBUTIONS
0 Posts
CONTRIBUTIONS
0 Public Channels
AVERAGE RATING
CONTRIBUTIONS
1 Discussion
AVERAGE NO. OF LIKES
1
Feeds
Discussion
Can someone tell me what's wrong with this code? This is a problem from Cody. For example, when n=3, the output should be the matrix [1 2 2 3 3 3]
function ans = your_fcn_name(n) n; j=sum(1:n); a=zeros(1,j); for i=1:n a(1,((sum(1:(i-1))+1)):(sum(1:(i-1))+i))=i.*ones...
1 year ago | 1
