Question: MATLAB QUESTION: Use matlab to plot the value of the function T_plate(x,y) along the line segment that connects (0,0) and (6,4). USE BOTH FUNCTIONS BELOW
MATLAB QUESTION: Use matlab to plot the value of the function T_plate(x,y) along the line segment that connects (0,0) and (6,4). USE BOTH FUNCTIONS BELOW IN THE SCRIPT YOU WRITE.
function tau = T_plate(x,y) % tau is temperature at (x,y) tau = 100*exp(-.4*( (x-1)^2 + 0.7*(y-3)^2)) + ... 80*exp(-.2*(2*(x-5)^2 + 1.5*(y-1)^2));
---------------------------------------
function fVals = fOnGrid(x,y,f) % x is a 1-by-n vector % y is a 1-by-m vector % f is a function handle that identifies a function of two variables. % fVals is an m-by-n matrix where fVals(i,j) = f(x(j),y(i)).
n = length(x); m = length(y); fVals = zeros(m,n); for j=1:n for i = 1:m fVals(i,j) = f(x(j),y(i)); end end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
