Generating pwlech with matlab coder for C language
이전 댓글 표시
I am trying to generate c langauge code for two-sided Welch PSD function : [pxx,f] = pwelch(x,window,noverlap,f,fs)
I generated and compiled the code successfully but when I try to run the given example without modifying it in an IDE (codeblocks) I got segmentation fault error specifically in generated function psdfreqvec()
댓글 수: 6
Darshan Ramakant Bhat
2021년 5월 10일
It is difficult to answer the question without more context. What is the example you are trying to follow ?
I hope you are following the generated example main() to check the usage of generated code :
Please attach the sample main() function of your application to verify the types of the inputs.
SAAD ELFENNI
2021년 5월 10일
Ezra Stein
2021년 5월 10일
Thank you for providing us with the MATLAB code. As a first troubleshooting step, could please re-generate the code with runtime checks enabled as described in the link below:
Enabling runtime checks will ensure that the generated code reports runtime issues via a call to 'fprintf' before aborting the program. If runtime checks are not enabled, then a runtime error may manifest as a segmentation fault. Runtime issues usually indicate that the input you provided to the entry point function was somehow ill-formed or unexpected.
If enabling runtime checks does not help resolve the issue, then could you please provide us with the commands you used to generate the code (such as the codegen command and any commands used to prepare a config object or entry point types)?
If you used the MATLAB Coder app to generate the code, could you use the project-to-script feature described in the link below to produce a codegen script and send it to us?
Also, make sure that you call the generated code's terminate function at the end of your main to ensure that the program is terminated correctly. In this case, the terminate function should be called 'DataCalibration_terminate'.
Areej Varamban Kallan
2021년 5월 11일
Hi,
Could you please share the inputs x ,fs and dBref that were used.
SAAD ELFENNI
2021년 5월 11일
SAAD ELFENNI
2021년 6월 6일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Algorithm Design Basics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!