write a function file, (2, err] = functioncalculation (x, y), which takes inputs z and y as two vectors ofarbitary lengths and calculates the following hunction. 2(ту) = 0.6х*с-0474 + 1.5 y2e-06x in matlab

main.m
function [z, err] = functioncalculation(x, y)
    z = 0.6 * x.*-0.0474 + 1.5 * y.^2 * exp(-0.000006 * x);
    err = 2;

% Example usage:
x = [1, 2, 3, 4];
y = [2, 3, 4, 5];
[z, err] = functioncalculation(x, y);
211 chars
9 lines

related categories

gistlibby LogSnag