Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

5 (Extra Credit-15 pts) Create a user defined function that accepts 3 mputs (in,

ID: 2074759 • Letter: 5

Question

5 (Extra Credit-15 pts) Create a user defined function that accepts 3 mputs (in, inL in3) and has i output (v). The function should add the first two inputs together into a new variable The function should square the 2d input and make(o). The function should divide the 3" inpust by 2 to create (ou). The function should then calculate values for the following equation and the be the output of the user defined function: y=3x1 + 2x1- 10x, Use the following vectors as inputs: in1·0:05:10 in2n 020 in3 «Q10:200 Be sure that you call the function properly and show that in your PDF

Explanation / Answer

% Code for user defined function

function [ y ] = math1( in1,in2,in3 )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
x1=in1+in2;
x2= in2.^2;
x3= in3./in2;
y= (3*x1.^3)+(2*x2.^2)- (10*x3);
end

% code for calling the function math1 after putting the required input value

clc
clear all
in1=0:0.5:10;
in2=0:20;
in3=0:10:200;
[ y ] = math1( in1,in2,in3 ) ; % calling function math1

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote