sfstoolbox / sfs-matlab

SFS Toolbox for Matlab/Octave
https://sfs-matlab.readthedocs.io
MIT License
98 stars 39 forks source link

gp_save_matrix needs vectors for x and y axis #46

Closed fietew closed 8 years ago

fietew commented 8 years ago

While introducing our new concept to include non-regular grids, we have not considered/tested the gnuplot functionalities. At the moment the gp_save_matrix needs vectors for x and y and yields an error if I execute

[P,x,y,z] = sound_field_mono(X,Y,Z,[xs,ns,1],'ps',1,f,conf);
gp_save_matrix('sound_field_line_source.dat',x,y,real(P));
hagenw commented 8 years ago

You can save it with

gp_save_matrix('sound_field_line_source.dat',x(1,:),y(:,1),real(P));

The question is, if we should change the function also to work as plot_sound_field()? This would have the disadvantage that we have to provide the conf variable as well and the function will not work well outside of the SFS Toolbox (as I use it also for other things). Another solution would be to check if we have matrices for x,y and then automatically use x(1,:),y(:,1).

hagenw commented 8 years ago

I did a fix by using now automatically x(1,:), y(:,1).