Taking input from user in matlab : -
Example Program : -
clc
clear all
close all
w = input ( 'width
(cm) = ' ) ; %
Taking input from user
l = input ( 'length
(cm) = ' ) ;
A = l * w ;
disp ( [ 'Calculation
Of Circle' ] )
disp ( [ '*********************'
] )
disp ( [ 'width
(cm) = ' , num2str(w) ] )
disp ( [ 'leagth
(cm) = ' , num2str(l) ] )
disp ( [ 'Area (cm2) = ' , num2str(A) ] )
Output : -
Taking Alphabetic input from user in matlab , We will use string 's' : -
Example Program : -
clc
clear all
close all
w = input ( 'width
(cm) = ' ) ; %
Taking input from user
l = input ( 'length
(cm) = ' ) ;
z = input ( 'What u want
to do? ' , 's') ; % Taking alphabetic input from user , we we will use
's'=(string)
A = l * w ;
disp ( [ 'Calculation
Of Circle' ] )
disp ( [ '*********************'
] )
disp ( [ 'width
(cm) = ' , num2str(w) ] )
disp ( [ 'leagth
(cm) = ' , num2str(l) ] )
disp ( [ 'Area
(cm2) = ' , num2str(A) ] )
Output : -
Keywords :-
·
How to take input from user in matlab ,
·
How to take input from user in matlab gui,
·
How to take matrix input from user in
matlab ,
·
How to take input vector from user in
matlab ,
·
How to take input function in matlab ,
·
How to take input string from user in
matlab ,
·
How to take input string in matlab ,
·
How to get input from user in matlab,
·
matlab programming , ultrajobz ,
· How to take user input in matlab ,
·
What is input () function
· Input MATLAB Function
0 Comments