add 2 numbers in matlab

To add two numbers in Matlab, you can simply use the "+" operator. Here's an example:

main.m
a = 5;
b = 7;
c = a + b;
25 chars
4 lines

In this example, we create two variables "a" and "b", and assign them the values 5 and 7, respectively. We then use the "+" operator to add the values of "a" and "b", and store the result in a new variable "c".

The value of variable "c" will be 12, which is the sum of "a" and "b".

gistlibby LogSnag