matlab2tikz with surf function (case of non square matrices)
Submitted by Anonymous on Tue, 25/05/2010
I apologize in advance if my question sounds a bit foolish, but I am trying to run the script in the case of the surf fonction.
The script does not run (error) if the plotted matrix is non square (surf(t, f, M) with length(t) ~= length(f)).
Even in the case of a square matrix, the script runs but does not return a correct result in the tikz file (only the first row).
Does anyone have an idea? A remark?
Best regards,
Sébastien
Forums:

Thanks --
Likely a bug. We didn't test this function with too many configuration before pushing it out.
Pooya is looking into the issue.
Ok, finally I have had a look
Ok, finally I have had a look inside the code:
inside of the drawSurface function, I have replaced:
[col, row] = size(dx); by [col, row] = size(dz);
And
str = [ str, ...
sprintf('(%g,%g,%g)', dx(i,j), dy(i,j), dz(i,j) ) ];
by
str = [ str, ...
sprintf('(%g,%g,%g)', dx(j), dy(i), dz(i,j) ) ];
Finally, it is ok for me
Thanks for your answer,
Sébastien
surf plot