This feature is not available in MATLAB 7.7 (R2008b).
As a alternative, you might want to refer to the following external sources:
Data type and data conversion utilities
<http://home.online.no/~pjacklam/matlab/software/util/datautil/index.html>
base64decode - Perform base64 decoding on a string
base64encode - Perform base64 encoding on a string
Please understand that we can not guarantee or support third party products or functions, however customers have reported to successfully work with the above functions before. You also might be interested in the following source:
<http://www.wikihow.com/Encode-a-String-to-Base64-With-Java>
To convert the figure to a string you can print it to the desired image format (using the menu or PRINT command) and afterwards read it to a string using low level I/O functions (FOPEN, FREAD, FCLOSE). Note the following example:
function str64 = encodeFigure( h )
filename = 'encodeFigure.png';
if exist('h','var')
print(['-f' num2str(h)], '-r300','-dpng', filename );
else
print( '-r300','-dpng', filename );
end
fid = fopen( filename, 'r' );
im = fread( fid );
fclose(fid);
str64 = base64encode( im, [] );
delete(filename);
end
Best Answer