From 573f35e05937914cb7f93dcf68db6f281415d67e Mon Sep 17 00:00:00 2001 From: sflorescu <43118429+sflorescu@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:36:14 +0100 Subject: [PATCH] Defined totalElements --- matlab/beamform_mex.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matlab/beamform_mex.cu b/matlab/beamform_mex.cu index cdb7147..264f07a 100644 --- a/matlab/beamform_mex.cu +++ b/matlab/beamform_mex.cu @@ -34,7 +34,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { int32_t *outData = static_cast(mxGetData(outArray)); // Copy the data - std::memcpy(outData, BF, totalElements * sizeof(int32_t)); + std::memcpy(outData, BF, 2 * frames * samples * sizeof(int32_t)); // Assign output plhs[0] = outArray;