i have 1x800 double and i need to outpu in header file all this values like this; float sineTable[800] = { /* values go here */ };

 採用された回答

Akira Agata
Akira Agata 2019 年 3 月 4 日

1 投票

How abou the following?
% Sample data
data = rand(1,800);
% Arrange it to comma-separated string
str = num2str(data);
str = regexprep(str,'\s+',',');
% Save as 'sample.h' file
fid = fopen('sample.h','w');
fprintf(fid,'sineTable[800] = {%s};\n',str);
fclose(fid);

1 件のコメント

Cem SARIKAYA
Cem SARIKAYA 2019 年 3 月 5 日
編集済み: Cem SARIKAYA 2019 年 3 月 5 日
thank you very much for your answer this is exactly what i want

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

その他の回答 (0 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by