Homework Solution: Write a MATLAB function that will be called like this:…

    Write a MATLAB function that will be called like this: Z = smart_math(X,Y) Assume the input variables X and Y are defined as lists of numbers. The return value of the function should be a list of values named Z, where each value of Z is calculated by using the corresponding values of X and Y according to this equation: latex2img.php?&density=150&source=Z%3D%5 Notes: Use element-by-element operations - Z should have the same number of elements that X and Y have. Your code must work for any valid lists of numbers. You do NOT have to use a loop for this problem. Example Test Case: X = [4 23.1 61 3]; Y = [3 2 1 .5]; Z=smart_math(X,Y); should have an output Z = [5.4777 11.5806 1.0164 1.6261]; Do not include any test cases in the code you submit. Assume X and Y are row vectors of equal length. Be sure to define and end your function properly.

    Expert Answer

    Write a MATLAB exercise that achieve be determined relish this:
    Z = smart_math(X,Y)
    Assume the input variables X and Y are mark-outd as rolls of total. The repay appraise of the exercise should be a roll of appraises determined Z, where each appraise of Z is congenial by using the corresponding appraises of X and Y according to this equation:

    latex2img.php?&density=150&source=Z%3D%5

    Notes:

    Interpretation element-by-element operations – Z should keep the identical estimate of elements that X and Y keep.

    Your legislation must performance coercion any strong rolls of total.

    You do NOT keep to interpretation a loop coercion this amount.

    Example Touchstone Case: X = [4 23.1 61 3]; Y = [3 2 1 .5]; Z=smart_math(X,Y);
    should keep an output Z = [5.4777 11.5806 1.0164 1.6261];

    Do not attributable attributable attributable embrace any touchstone cases in the legislation you succumb.

    Assume X and Y are grade vectors of resembling extension.

    Be confident to mark-out and purpose your exercise right.

    Expert Response

     

    Executable legislation:

    Program

    exercise Z=smart_math(X,Y)

    Z=((X.^Y)+sqrt(Y))./(X.*Y);

    end

    X = [4 23.1 61 3];

    Y = [3 2 1 .5];

    smart_math(X,Y)