MATLAB OUTPUT statement

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.