input( )


input( ) function in Matlab


Syntax:           result = input(prompt)

                        str = input(prompt, 's')

Description:   

  • result = input(prompt) displays the prompt string on the screen, waits for input from the keyboard, evaluates any expression in the input, and returns the result.
  • str = input(prompt, 's') returned the entered text as Matlab string, without evaluating expression.


Note :  prompt is the query that requests input, result is one that is calculated from input and str is the exact text or input.





Code :


% Matlab Function - input
% Syntax : 
% result = input(prompt)
% result = input(prompt, s)

%Function
result = input('Enter an expression, I will solve for you : ');

%Result
disp('Value is ');
disp(result);

result = input('What is your name? : ', 's');

%Result
disp('You name is ');
disp(result);





No comments:

Post a Comment