I have an 3 dimensional array that represents an xy grid, and the z vector represents depth. I only know depths of certain rows and am trying to interpolate the array. My questions is how do I create a 720x400 array, without setting all the values to 0 (as that could affect the interpolation).
Thanks!
You can use:
A = nan(m,n,...);
to initialize a matrix with NaN's, if that is what you ask for. Other popular choices are inf(m,n,...) to initialize with Inf's and ones(m,n,...) to initialize with 1's.
So, to create a 720x400 matrix full of NaN's you can just:
A = nan(720,400);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With