How can I read data from a text file with code deployed on a Raspberry ?

I have made text file containing audio data (2 columns of doubles separated by a space) with a code deployed on a Raspberry. Now, I want to use this text file to play audio data through the speakers plugged to the Raspberry (so that's another code deployed on the Raspberry).
The problem, when I use fread, is that I don't receive correct values. I would like to use something similar to importdata() but it does not support code generation.
How can I do ?

 採用された回答

Kiran Felix Robert
Kiran Felix Robert 2021 年 6 月 21 日

1 投票

Hi Guilhem ,
You can try using fscanf for reading text files. This also supports Code Generation.

1 件のコメント

Guilhem Schena
Guilhem Schena 2021 年 6 月 21 日
I thought I already tried this, but I didn't. And it works well, thanks !

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Support Package for Raspberry Pi Hardware についてさらに検索

製品

リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by