Hi Hao,
As you say, the problem is with reshape
. The GPUmat implementation doesn't allow the use of []
to allow the dimensions to be calculated automatically. This error should only occur when using an object of the kWaveTransducer class as a sensor with GPUmat.
In this case, you can replace the line where you are receiving an error with:
sensor_data(:, file_index - sensor_data_buffer_size + 1) = sum(reshape(sum(reshape(current_vals, sensor.number_active_elements*sensor.element_width, sensor.element_length), 2), sensor.element_width, sensor.number_active_elements).', 2);
And similarly for the case without elevation focusing:
sensor_data(:, file_index) = sum(reshape(sum(reshape(p(sensor_mask_ind), sensor.number_active_elements*sensor.element_width, sensor.element_length), 2), sensor.element_width, sensor.number_active_elements).', 2);
Let me know if you still receive errors after this.
Brad.