Execute S Function Builder Using Windows Subsytem for Linux?

10 vues (au cours des 30 derniers jours)
Andrew Poissant
Andrew Poissant le 14 Août 2019
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.

Réponses (1)

Pratyay Pande
Pratyay Pande le 24 Août 2021
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.

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by