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 :
% entering an integer input("Enter an integer : ") % entering a string input("Enter a string : ", "s") |
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 a string display("GeeksforGeeks") % output a variable var = 10; display(var) |
Output :
GeeksforGeeks var = 10
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
Recommended Posts:
- Matlab program to rotate an image 180 degrees clockwise without using function
- Extract bit planes from an Image in Matlab
- Image Processing in MATLAB | Fundamental Operations
- MATLAB | RGB image representation
- MATLAB | RGB image to grayscale image conversion
- MATLAB | Complement colors in a Binary image
- MATLAB | Converting a Grayscale Image to Binary Image using Thresholding
- MATLAB | Complement colors in RGB Image
- MATLAB | Complement colors in a Grayscale Image
- Draw Switzerland Flag Using Matlab
- MATLAB | Display histogram of a grayscale Image
- LSB based Image steganography using MATLAB
- Draw Sweden Flag using matlab
- Difference Between MATLAB and Scilab
- How to draw Japan flag using MATLAB
- Draw Kuwait Flag using MATLAB
- Draw Sudan Flag using MATLAB
- Draw Indian Flag using matlab
- Draw Seychelles Flag using MATLAB
- Plot a line along 2 points in MATLAB
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

