Plot my own function 'in two variables'

59 Views Asked by At

I have matlab function in two variables say $function_{something}(t)$ where $t$ is of size $2 \times k$, this is to allow to evaluate $k$ times in two values. So my output is then a $k \times 1$ vector. Now, I want to make a plot on $[0,1] \times [0,1]$ with "equidistant" grid points, say $0,0.1,0.2,...,1$ in both dimensions. How can I do this? Do I need to change the code of $function_{something}$ in order to readily use existing plot methods?

I have totally no experience with flexible 3D plots.

1

There are 1 best solutions below

0
On

In the future, this should be posted on stackoverflow since it's a programming question and not a mathematics one. However, something like this will work:

v = 0 : 0.1 : 1;
[ x, y ] = meshgrid( v );
f = reshape( foobar( [ x(:), y(:) ]' ), sizeof(x) );
imagesc( v(:)', v(:), f );