k-Wave Toolbox |

## Troubleshooting

If you are unable to run the examples or see the help files included within the k-Wave Toolbox, first check that the k-Wave Toolbox has been added to the MATLAB path. To add a directory to the MATLAB path, either use the addpath command or go to File/Set Path/Add Folder on the dropdown menus in the main MATLAB window and select the root k-Wave Toolbox folder. You will need to restart MATLAB before the help files will appear in the help browser.

If you are encountering problems using specific combinations of inputs using Octave or older versions of MATLAB, try turning the display off by setting the optional input parameter `'PlotSim'` to `false`, using a binary sensor mask or setting `'CartInterp'` to `'nearest'`, and using the default settings for `'DataCast'` (optional inputs are given as `'string', value` pairs following the `kgrid`, `medium`, `source`, and `sensor` inputs).

If you are still having problems go to the online k-Wave User Forum and search for an answer or post a question.

Back to Top

## Compatability with earlier MATLAB versions

To use k-Wave with MATLAB versions prior to 2008a, type `open kspaceFirstOrder2D` at the MATLAB command line and replace lines 675 to 704 with:

    try
        disp('  calculating Delaunay triangulation (tsearch)...')
        [zi, del_tri] = gridDataFast(kgrid.x, kgrid.y, p, sensor_x, sensor_y);
        use_TriScatteredInterp = false;
    catch
        error('The inbuilt function tsearch is not supported in this version of MATLAB. Try running the simulation with ''CartInterp'' set to ''nearest'' or using a different data type.');
    end

Similarly, type `open kspaceFirstOrder3D` and replace lines 763 to 773 with:

    error('Linear interpolation is not supported in this version of MATLAB. Try running the simulation with ''CartInterp'' set to ''nearest''');

Back to Top

© 2009, 2010, 2011 Bradley Treeby and Ben Cox.