How can S-function builder work with fixed point inputs and outputs?
3 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I'm using MATLAB R2017a with Windows 10 64 bits. The compiler installed in the computer is MinGW64 Compiler. Then, my objective is to use S-function builder with inputs and outputs as fixed point variables. I want to use the different functions compiled in the libfixedpoint.lib library as, for example, trigonometric functions.
The data type of input u0 and output y0 are defined as fixed-point binary point scaling with the word length as 32 bits and the fraction length as 21 bits. The output code is very simple: y0[0] = u0[0]. When I click the Build bottom the next message appears: "gcc:error:libfixedpoint.lib: No such file or directory"
In the Libraries pane I have wrotten the next command (inside the Library/Object/Source files (one per line) window): LIB_PATH C:\Program Files\MATLAB\R2017a\extern\lib\win64\microsoft\libfixedpoint.lib. But I look for this file in the computer and the path it is correct.
Finally, which is the procedure to configure the S-function builder block working with Fixed-Point Variables?
0 件のコメント
回答 (1 件)
Gillian Rosen
2017 年 9 月 27 日
Hi Carlos,
I understand that you are creating an S-Function using the S-Function Builder block with fixed-point inputs and outputs. You are getting an error when you try to build that the 'libfixedpoint.lib' library cannot be found, and you would like to know what you need for configuring the S-function builder to use fixed-point variables.
For the build error, the following troubleshooting questions may help narrow down the issue:
1. Are you able to include other libraries from this folder?
2. Are you able to include libraries from other locations, such as your current folder?
3. Are you able to include source/object files without error?
When you set the data types of the input and output to a fixed-point type, the S-Function builder will automatically add the appropriate #include directories for working with fixed-point variables to the generated S-Function. You can open the generated S-Function file and see that they have been added as indicated in the following documentation page:
2 件のコメント
Gillian Rosen
2017 年 9 月 28 日
The S-Function Builder block is only able to create C-MEX S-Functions, so you will need to use C code inside this block.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!