anyone knows how to use matlabSolution Some simple MATLAB co
anyone knows how to use matlab?
Solution
>> Some simple MATLAB commands are presented that will make you ubderstand on how to use matlab :
The MATLAB environment (on most computer systems) consists of menus, buttons and a writing area similar to an ordinary word processor. There are plenty of help functions that you are encouraged to use. The writing area that you will see when you start MATLAB, is called the command window. In this window you give the commands to MATLAB. For example, when you want to run a program you have written for MATLAB you start the program in the command window by typing its name at the prompt. The command window is also useful if you just want to use MATLAB as a scientific calculator or as a graphing tool. If you write longer programs, you will find it more convenient to write the program code in a separate window, and then run it in the command window (discussed in Intro to programming).
In the command window you will see a prompt that looks like >> . You type your commands immediately after this prompt. Once you have typed the command you wish MATLAB to perform, press <enter>. If you want to interupt a command that MATLAB is running, type <ctrl> + <c>.
The commands you type in the command window are stored by MATLAB and can be viewed in the Command History window. To repeat a command you have already used, you can simply double-click on the command in the history window, or use the <up arrow> at the command prompt to iterate through the commands you have used until you reach the command you desire to repeat.
Useful functions and operations in MATLAB
Using MATLAB as a calculator is easy.
Example: Compute 5 sin(2.53-pi)+1/75. In MATLAB this is done by simply typing
5*sin(2.5^(3-pi))+1/75
at the prompt. Be careful with parantheses and don\'t forget to type * whenever you multiply!
Note that MATLAB is case sensitive. This means that MATLAB knows a difference between letters written as lower and upper case letters. For example, MATLAB will understand sin(2) but will not understand Sin(2).
