Output argument not assigned on some execution paths

8 visualizaciones (últimos 30 días)
xuejun ni
xuejun ni el 28 de Oct. de 2021
Editada: xuejun ni el 26 de Nov. de 2021
I am trying to run MATLAB Coder to transform a MATLAB .m file into .mex to generate matlab code to C code. When trying to build the file via MATLAB Coder engine, I get the error message state "Output argument "F_Data" not assigned on some execution paths", is there anyone know the problem with the code and how to solve this

Respuestas (1)

DGM
DGM el 28 de Oct. de 2021
Editada: DGM el 28 de Oct. de 2021
The problem occurs in these two cases:
if N_Start_Freq<0
sprintf('%s','raise up f')
return
end
if N_Stop_Freq>fs/2
sprintf('%s','lower down f')
return
end
If either condition is true, the function returns immediately without assigning anything to F_Data or f. You might assign some placeholder value to them if that's the way you want it.
If these are error conditions wherein the output is not meaningful, you can use error() instead.
if N_Start_Freq<0
error('F_CutFFTResult: Start frequency is too low')
end
if N_Stop_Freq>fs/2
error('F_CutFFTResult: Stop frequency is too high')
end

Categorías

Más información sobre MATLAB Coder en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by