Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Generating an raw unsigned char file with a sinus.
- % open file sample.raw for writing, generate values
- % write file and close (incedentaly plot)
- myfile = fopen ("sine.raw", "w");
- x = linspace(0, 2*pi, 64);
- y = 128*sin(x)+128;
- fwrite(myfile,y,"uint8");
- fclose(myfile);
- plot(x, y);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement