Hello,
I think I've found a few places in the code where, due to this odd behavior of the function isfield
which always returns false if called on a user defined class, a few error messages are silent. This mainly affects when isfield
is used to check fields on a kwaveTransducer used as a sensor or source.
More info on this behaviour here: https://uk.mathworks.com/matlabcentral/answers/94688-why-does-isfield-always-return-false-when-querying-a-user-defined-class-in-matlab-7-7-r2008b
The places I've been able to locate where this results in actual behavioral changes are:
- In kspaceFirstOrder3DC, there is a check for record_start_index that never succeeds, so the command line option isn't propogated
- In kspaceFirstOrder_inputChecking, in the lines
% check that the transducer is only being used in forward mode
if isfield(sensor, 'time_reversal_boundary_data')
error('Transducer inputs not supported with time reversal.');
end
% check that sensor.record is not set
if isfield(sensor, 'record')
error('sensor.record cannot be set when using kWaveTransducer objects as the sensor.');
end
the errors are never called even if the field is present.
I've had a look through all of the other places that isfield is used, and I don't think there is any other shadowed behaviour, but it might be worth someone else taking a look as it is used a lot.
Kind regards,
Chris