Execute S Function Builder Using Windows Subsytem for Linux?

16 ビュー (過去 30 日間)
Andrew Poissant
Andrew Poissant 2019 年 8 月 14 日
回答済み: Pratyay Pande 2021 年 8 月 24 日
I am trying to integrate C code into my Simulink model using the S Function Builder block. I typically run matlab and Simulink on Windows 10. The C code is for *nix systems, which I have been running on Ubunutu 16.04 via Windows Subsystem for Linux (WSL). However, now I want to integrate the C code into my Simulink model using the S Function Builder block. I keep running into an error when trying to build the S Function saying "fatal error: termios.h: No such file or directory" because termios.h is designed for *nix systems. Is there a way to have the S Function builder block access WSL so I may run this C code in my Simulink model? I have not been able to find a similar header to termios.h for Windows OS.

回答 (1 件)

Pratyay Pande
Pratyay Pande 2021 年 8 月 24 日
Hi Andrew,
A possible workaround is to use Ubuntu 16.04 on a virtual machine, install MATLAB and execute the Simulink model there. I assumed that you are not using any Windows specific functions in your Simulink model. Also, please note that support for Ubuntu 16.04 will be dropped in the upcoming MATLAB release.
The error message may be thrown because termios.h might not have been included in the MATLAB path. Ensure that termios.h is in an accessible location in your filesystem and has been included in the MATLAB path.
As you have mentioned, it may also be the case that termios.h has been designed for *nix systems and contain some dependencies or commands that are specific to Linux systems only. Unfortunately, since S-Function Builder Block cannot access WSL, you will need to include the header file.

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by