tommyears
Industrial
- Apr 18, 2006
- 3
Hi All,
I would like to create a square array i.e 4x4 and then plot a vector of data (16 elements) over this 4x4 array.
I have created the following code, it doesnt work but thats what I am ideally aiming after:
[X,Y] = meshgrid([1:1:4]);
z = [30 20 20 30 20 10 10 20 20 10 10 20 30 20 20 30];
mesh(X,Y,z)
The reason that I believe that it doesnt work is that my z variable is not a funtion of X or Y. But it isn't in real life so how do I get around this?
Regards
Tom
I would like to create a square array i.e 4x4 and then plot a vector of data (16 elements) over this 4x4 array.
I have created the following code, it doesnt work but thats what I am ideally aiming after:
[X,Y] = meshgrid([1:1:4]);
z = [30 20 20 30 20 10 10 20 20 10 10 20 30 20 20 30];
mesh(X,Y,z)
The reason that I believe that it doesnt work is that my z variable is not a funtion of X or Y. But it isn't in real life so how do I get around this?
Regards
Tom