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개)

카테고리

태그

질문:

2019년 3월 4일

편집:

2019년 3월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by