Requirements: this exercise, you will write a function trough_create that create
ID: 3587408 • Letter: R
Question
Requirements: this exercise, you will write a function trough_create that creates the vectors y and ye that form the outline for the cross-section of a trough. Input variables: Func -Any arbitrary function of x in MATLAB, eg. Func = @(x) x^2-4 EndPoint - The final value within the x vector. Output variables: xa linearly spaced vector with 119 elements. It starts at 0 and ends at EndPoint ythe vector Func(x); ye - a vector that has the same element as x, but where each element is equal to the initial value for y. Potentially Useful Functions: linspace, ones. Function Template: function [x,y,ye] % INSERT CODE trough-create(Func , EndPoint) HERE - endExplanation / Answer
clc;
clear all;
close all;
function [x,y,y0] = trough_create( Fun,EndPoint);
x=linspace(0,EndPoint,119);
y=feval(Fun,x);
y0=y(1)*ones(size(x));
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.