Assignment is the method of giving a value to a varaiable. You have already seen this in the interactive mode. We write x=a to give the value of a to x. Here is a short program illustrating the use of assignment.
function r=mod(a,d) % r=mod(a,d). If a and d are integers, then r is the integer % remainder of a after division by d. If a and d are integer % matrices, then r is the matrix of remainders after division % by corresponding entries. Compare with MATLAB's rem. r=a-d.*floor(a./d)
If you are using MATLAB on a PC you will need to set path so that MATLAB can find you program. To do this click on File in the menu bar and then click on set path. Next select the folder the contains your m-file and click save. Now you can call the function from within MATLAB.
Now assign some integer values for a and d. Run
mod(a,d)
help mod
type mod