# write a matrix from a function (say h(m,n), where m and n are running index)

1 view (last 30 days)

Show older comments

##### 0 Comments

### Answers (1)

José-Luis
on 30 Aug 2017

Edited: José-Luis
on 30 Aug 2017

myFun = @(x,y) x.^2 + y;

result = bsxfun(myFun,1:3,(1:3).')

If I understood your question right, then you'd just need to replace myFun with your own function.

##### 4 Comments

José-Luis
on 30 Aug 2017

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!