Question: Given the 5 functions ( f 1 - f 5 ) , and the live script provided, write a script to plot all the functions
Given the functions ff and the live script provided, write a script to plot all the functions as shown in the live script.
f:
function y fx
x is a scalar, and y is a scalar
if lengthx ~
errorx is wrong dimensions'
end
y x x;
end
f:
function y fx
x is a scalar, and y is a vector
if lengthx ~
errorx is wrong dimensions'
end
y x; x;
end
f:
function y fx
input is a scalar, output is a vector
if lengthx ~
errorx is wrong dimensions'
end
y x; x; x x;
end
f:
function y fx
x is a vector of dimension x y is a vector of dimension
if sizex ~
errorx is wrong dimensions'
end
A xx; x x x;
y A x;
end
f:
function y fx
x is a vector of dimension y is a vector of dimension
if lengthx ~
errorx is wrong dimensions'
end
A xx; x x x; x x;;
y A x;
end
Live script:
HW
clf;
clear;
Load up the data
nGridPts;
f
FunctionSampler @;
DataPlotter xy;
f
FunctionSampler @;
DataPlotter xy;
f
FunctionSampler @;
DataPlotter xy;
f
FunctionSampler @;;;
DataPlotter ;
f
FunctionSampler @;;;
DataPlotterxy;
All twodimensional functions x has two dimensions should be plotted in a contour plot f and f All onedimensional functions should be in line or scatter plots ff
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
