19_pdfsam_2 - > temp = 78 temp = 78 disp: There are two...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
>> temp = 78 temp = 78 disp : There are two general forms of the command disp that are useful in displaying results and annotating them with units or other information: 1. disp( variable ) : Displays value of variable without displaying the variable name. 2. disp( string ) :D i sp lay s string by stripping oF the single quotes and echoing the charac- ters between the quotes. String: A group of keyboard characters enclosed in single quote marks ( ). The quote marks indicate that the enclosed characters are to represent ASCII text. >> temp=78; >> disp(temp); disp(’degrees F’) 78 degrees F Note that the two disp commands were entered on the same line so that they would be executed together. fprintf One of the weaknesses of Matlab is its lack of good facilities for formatting output for display or printing. A function providing some of the needed capability is
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/07/2010 for the course ENG 101 taught by Professor Chang during the Summer '09 term at 東京国際大学.

Ask a homework question - tutors are online