Anda di halaman 1dari 1

M-file:1] Script file

2] Function File
*function is used to reduce program size.
* to open script file we can use shortcut ctrl+N ( editor).
we cannot save the script file name as any specified command name of Matlab.eg.
'123','sin' etc.
we also cannot save the file using the variables used in script.
*
to call a function in a script .both files should be in a same folder loaction.
% it is not neccessary to take variable name as same as given in function.
%fucntion doesn't depend upon the name of input variable.
$there is no do while loop in MATLAB.
conditional statement:1) if(condition)
statements....
....
.....
'end' or we can use else if want.
2) to use printf in MATLAB we use command 'disp(a)' or
3)if(condition)
statements....
....
.....
else(conidtion)
statements....
...
...
end

Anda mungkin juga menyukai