VOOZH about

URL: https://www.geeksforgeeks.org/matlab/simple-input-output-program-in-matlab/

⇱ Simple Input/Output Program in MATLAB - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Simple Input/Output Program in MATLAB

Last Updated : 20 Aug, 2020
Let us see how to input and output data in MATLAB.

input()

Syntax : input(PROMPT, "s") Parameters :
  • PROMPT : text prompted
  • "s" : optional, to input a string
Returns : the data entered
The input() function is used to input data in MATLAB. Example : Output :
Enter an integer : 10
ans = 10
Enter a string : GeeksforGeeks
ans = GeeksforGeeks

display()

Syntax : display(OBJ) Parameters :
  • OBJ : the object to be displayed
Returns : Nothing
The display() function is used to output data in MATLAB. Example : Output :
GeeksforGeeks
var = 10
Comment