how to make a dat file in matlab to check values coming from fpga?

2 views (last 30 days)
i am doing my final year project related to video compression using fpga, for that matter i need to send an image first through matlab, get it compressed and see the results, what I am getting back from fpga can be seen thorough .dat file. if anyone can suggest me any solution?

Accepted Answer

Walter Roberson
Walter Roberson on 14 Dec 2011
You can write a .dat file by using fopen(), fwrite(), fclose(). You will need to find documentation on the exact binary format of the .dat file, as there is no standard for ".dat" files.
However, writing a .dat file is unlikely to do you any good. You probably want to read the .dat file produced by the fpga and compare that to the values you have in memory. To read a .dat file you need fopen(), fread() and fclose() -- though again you need detailed documentation on the binary format as there is no standard for ".dat" files.
  2 Comments
Umar Anjum
Umar Anjum on 15 Dec 2011
so what do you suggest me to do, so that i may read/compare the two set of values!
Walter Roberson
Walter Roberson on 15 Dec 2011
First step is to get documentation on the internal format of the .dat files. Then write code to read a .dat file and return the image as an array.
To compare images, you can use isequal() if you want to compare them for exact equality. If exact equality is not what you want, then you need to describe what kind of comparison you do want.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!