Hi there,
Just wanted to check if k-wave is compatible with Mac OS versions of Matlab and if so how would you install it as there only appears to be instructions for Windows and Linux? I am using Matlab R2012a.
Cheers!
Hi there,
Just wanted to check if k-wave is compatible with Mac OS versions of Matlab and if so how would you install it as there only appears to be instructions for Windows and Linux? I am using Matlab R2012a.
Cheers!
Hi HTHEGREAT,
Should work fine on a Mac; I use that all the time. I guess we didn't put separate instructions as we think of OS X as close to Linux. Just download the k-Wave folder and save it somewhere, then set the Matlab path to point to it. That's all! Please post back if you run into any issues.
Thanks,
Ben
Ah cheers Ben, yeah managed to get it working just after I posted. Just wanted to check, my DSP lecturer recommended your software as I am trying to make a model (ray tracing) of sound propagation outdoors. Obviously I won't have specific dimensions but it is to make a model of the sound source changing over time due to weather conditions. Sorry if that sounds vague! Will your code be capable of helping to simulate this?
Cheers
Heather
Hi Heather,
Glad you got it going.
I'm not entirely clear what you want to do. You can put in a time-varying acoustic source, but not time-varying medium properties. You can use a spatially-varying sound speed, eg. you can include a depth-dependent sound speed profile, - so should be able to model wavefront bending due to the effect of wind on the sound speed, for example - but you can't set time-varying sound speed profile (so in this example the wind would have to be constant in time).
Hope that helps,
Ben
Hi everyone,
I've just installed V1.1 with Matlab Version 2016b but received the error shown below when running the example_ivp_homogeneous_medium.m file. Your help will be greatly appreciated. Kind Regards
Ezzat
Error using nargout
You can only call nargin/nargout from within a MATLAB function.
Error in kspaceFirstOrder_inputChecking (line 35)
if nargout == 2 && ~strcmp(calling_func(3).name, 'benchmark')
Error in kspaceFirstOrder2D (line 496)
kspaceFirstOrder_inputChecking;
Error in example_ivp_homogeneous_medium (line 67)
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor);
Hi ezzatoa,
Thanks for flagging this. It seems that k-Wave V1.1 and earlier do not work with MATLAB 2016b. Something has changed in the MATLAB error checking, and for some reason the use of nargin
and nargout
in subscripts is no longer allowed. We'll make sure to fix this in the next release. In the meantime, I'd advise using a slightly older version of MATLAB if you have access to one.
Brad.
Hi Brad,
I am also having this problem on Windows 10. Is there some sort of ctrl+f and replace that I can do to change the nargin name so this will run this on MATLAB 2016b? Thank you.
Charlie Clayton
Hi Charlie,
I haven't had time to check this, but I imagine if you define a new variable at the beginning of each of the simulation functions, something like kwave_nargin = nargin;
, and then replace nargin
with kwave_nargin
in each of the sub-scripts in the private folder, then hopefully it should work.
Hope that helps,
Brad.
Hi Bradley,
With these changes example works fine in 2016b. Thanks!
Hi everyone,
Can anyone who solved the nargin/out problem in R2016b provide more information on how to implement " define a new variable at the beginning of each of the simulation functions, something like kwave_nargin = nargin;, and then replace nargin with kwave_nargin in each of the sub-scripts in the private folder" please?
Thanks,
Shane
Hi Shane,
What part are you stuck on? First, open each of the following simulations functions:
kspaceFirstOrder1D
kspaceFirstOrder2D
kspaceFirstOrder3D
pstdElastic2D
pstdElastic3D
and add the following lines to the beginning of the function:
% get the number of inputs and outputs (nargin and nargout can't be used in
% subscripts in MATLAB 2016b or later)
num_inputs = nargin;
num_outputs = nargout;
Then open the following subscripts in the private folder
kspaceFirstOrder_checkOptionalInputs
kspaceFirstorder_checkMemoryUsage
and replace nargin
with num_inputs
, and nargout
with num_outputs
.
Brad.
Hi Bradley, thanks for the help! However I noticed that in my private folder there is no subscript called kspaceFirstOrder_checkOptionalInputs. There is one called kspaceFirstOrder_inputChecking.m
Would the appropriate changes work if I just do it in that subscript instead?
Thanks
Yes, that's the correct file, apologies!
Brad.
Use k-wave in matlab R2016b just now.
Thanks for the tips of debugging!
use k-wave in matlab 2017a just now.
Thank you for the tips
You must log in to post.