How to Perform addition/subtract/multiplication/division for two different vectors of the same length?
Here are the two different vectors of the same length. a = [2, 1, 4]; b = [2 2 1];
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Aviance School is one of the largest web solutions platform in India for developers to learn and share their programming knowledge and build their careers.
>> a = [2 1 4]; b = [2 2 1]; c = a + b
c =
4 3 5
>> c = a – b
c =
0 -1 3
>> c = a .* b
c =
4 2 4
>> c = a ./ b
c =
1.0000 0.5000 4.0000