MATLAB Answers

Something to replace 'dir' command?

3 ビュー (過去 30 日間)
Ahmet Soner Erikli
Ahmet Soner Erikli 2020 年 4 月 22 日
回答済み: Walter Roberson 2020 年 4 月 23 日
I am trying to convert my function to C Code with Matlab Coder. but Matlab Coder cannot convert 'dir' command. But somehow I need to get at least the names of some .csv files in a folder. How can I do this without using dir command?

  1 件のコメント

Geoff Hayes
Geoff Hayes 2020 年 4 月 22 日
Ahmet - you may need to code this in C/C++.

サインインしてコメントする。

回答 (3 件)

Walter Roberson
Walter Roberson 2020 年 4 月 23 日
You should assume that there will not be any MATLAB Coder support for anything that interfaces with the operating system, as MATLAB Coder is aimed at mostly embedded devices. Some functions do have support, with the likelihood increasing for functions that have an equivalent in the C standard library, but not even all of that is supported.
You will probably need to use coder.ceval or similar to put in a call... but remember that directory services are fairly operating system specific. Mac and Linux targets can use Posix directory facilities, but current Windows does not have a Posix library.

  0 件のコメント

サインインしてコメントする。


andrea
andrea 2020 年 4 月 22 日
Maybe ls command would work

  0 件のコメント

サインインしてコメントする。


Darshan Ramakant Bhat
Darshan Ramakant Bhat 2020 年 4 月 23 日
Below is the list of functions supported for code generation :
Please check if some thing from this list is useful to you.
Otherwise you can call the external C function that you have written using the below workflow :

  0 件のコメント

サインインしてコメントする。

カテゴリ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by