I have taken an open source code from this **broken link removed** link, but i'm not knowing how to read/write text file in VHDL and getback an image in matlab. Please help me.
Seems like you want to do this as part of a testbench? I'm assuming you know that VHDL is a hardware description language and you can't synthesize file I/O operations into hardware.
Regardless of your intent...You could have used google like I did: "vhdl file io example"