http://www.labfans.com/bbs/t11883/
First, you need to determine where you want to export the output to, whether it is a file or a commend window. fprintf is to output data in a certain format to a file, disp is to output a hint string or variable value to the commend window, you can also output a hyperlink. Such as:
fprintf:
x = 0:.1:1;
y = [x; exp (x)];
FID = fopen (' exp.txt ', ' wt '),% need to open a file first
fprintf (FID, '%6.2f%12.8f\ n ', y); %
Fclose (FID)
Disp
Disp (' Corn Oats Hay ')
Disp (rand (5,3))
The results are displayed in the command window:
Corn Oats Hay
0.2113 0.8474 0.2749
0.0820 0.4524 0.8807
0.7599 0.8075 0.6538
0.0087 0.4832 0.4899
0.8096 0.6135 0.7741
Other than that:
Disp (' <a href = "http://www.mathworks.com" >the mathworks Web site</a> ')
Show a hyperlink: TheMathWorks Web Site__________________
MATLAB OUTPUT statement