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 で MATLAB Coder についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!