Explore BrainMass
Share

Explore BrainMass

    Matlab Functions: Two Row Vectors as Inputs

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Write a Matlab function that will accept two row vectors (A and B) as inputs. The function computes the row vector C that is the term-by- term product of A and B (that is, C1= A1*B1, C2=A2*B2, and so on), and that then computes the values of the function sin(x) for each value of C and stores these values in the row vector D. The outputs of the program are the arrays C and D.

    For demonstration of the function, the array A and B are:
    A = 1.2, 3.5, 6.7, 8.3, 0.9, 4.2
    B = 0.5, 1.0, 0.08, 0.2, 1.3, 0.85

    © BrainMass Inc. brainmass.com October 9, 2019, 9:00 pm ad1c9bdddf
    https://brainmass.com/engineering/mechanical-engineering/matlab-functions-two-row-vectors-inputs-169543

    Solution Preview

    I attached two files.

    "Term_by_term.m" contains the requested function. It checks that the ...

    Solution Summary

    This solution provides guidelines on how to write a Metlab function that will accept two row vectors as inputs.

    $2.19