`Hey,
Note: If you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
clc%clears screen
clear all%clears history
close all%closes all files
format long
x=1:0.2:4;
y=1:0.2:4;
[X,Y]=meshgrid(x,y);
Z=zoom(X,Y);
X=X(:);
Y=Y(:);
Z=Z(:);
table(X,Y,Z)
function Z=zoom(X,Y)
Z=exp(sqrt(X.^2+Y.^2))./(X+Y);
end
Kindly revert for any queries
Thanks.
Create a function m-file for the following expression which has two inputs X and Y. Call...
Write a user-defined MATLAB function for the following math function y(x). The input to the function is x and the output is y. y(x)=-(0.2*x^4)+((e^-0.5*x)*x^3)+7*x^2 Call the function to calculate y(x) over the interval -3 ≤ x ≤ 4 for each increment of 1. Display x and corresponding y(x) in a text file with labeled column headings. Use the type command to display the contents in the text file.
Problem 6 (programming): Consider a two-dimensional function f(x.y) stored in the file f.mat on TritonED. Down load the file and load it into MATLAB. The file includes 3 variables: x, y and f, where f contains 2-dimensional function values at (x, y). You can execute: surf(x, y, f); shad ing interp; view(3); in the command window to visualize the function. Do not put the command in your homework script. In the following exercises, estimate the double integral: maz(ycmax(z) f(x, y)...
PLEASE HELP, MATLAB, answers are very appreciated need to study pl 2. Write two m-file functions that will allow you to compare mortgages cakculations for the monthly payment and compare mortgage with different loan values. The monthly payment M, is calculated using 1-2)1 Where Pis the principal loan amount, r is the interest rate (in decimal form not percent form), and y is the number of years of the loan. Create an m-file function called "mortgage_a.m" that will serve as...
matlab only Question 5: a.) Write an m-file using conditional statements to evaluate the following function, assuming that the scalar variable x has a value. The function is for x <-1 - 3e y=2+cos(m) for-1 x<5 y 10-5)+1 for r 2 5 Use your file to evaluate y for x5, x-3, and x-15, and Use keyboard entry for values of x. b.) Use a for loop in the above file to plot the above function over the interval -2x <10....
Use an anonymous function instead of a function file that calculates y(x) = sin(2x)( 4x2 + 3 ). Plot it using fplot, x goes from -8 to 8. Use your function to print out the value of y for x = -1.25 and x = 1.25. Deliverables: Script with anonymous function Plot using fplot Command window output Step by Step Instructions: Copy your calling script from Problem 1 Change the name of the function to be LabFcAnonymous (or something similar)...
Please show the code necessary, and explanations on MATLAB. Plotting 11) Plot the function y = sin(x) from x = 0 to 21. 12) Plot the functions y = x2 z = x2 + 2x + 1 from x = 0 to 2 on the same graph. Scripts: Input and Output 13) Write a script (M-file) to read in a message at the command line using the MATLAB input function and then display the message to the Command Window using...
1) Filename: MAE1090_HW7_1.m Write an m-file that determines the maximum value in a vector, x, and stores that maximum value as the variable y. Your m-file should work for both row and column vectors. For the purpose of testing and grading your m-file: DO NOT issue a clear command at the start of your m-file DO NOT define the vector x within your m-file. That vector should exist in the workspace prior to executing your m-file. Do...
Create a Function file using Matlab. function sums = estimSum (nTerms) Before we go much further, save your file and name it the exact name of the function, estimSum Inside the function file just created, write the code needed to compute partial sums 1)k+1 2k 1 k-1 and compare the output in each case to the value of by computing the remainder Rn- _Snl for each n - 20,50, 100, 1000. When calling the function in Matlab's command window for...
10) you will run/call the function with these given values. (b) Write a flow chart and the script file using conditional statements with logical operator if/else and if/elseif, to evaluate the following function, assuming that the scalar x has a value: y 2 sin(m) for-1 x < 5 y=10(X-5) + 1 for x 25 Use your file to evaluate y for x5,x 3 and x 15 by hand 10) you will run/call the function with these given values. (b) Write...
1. (25 pts) Given the following start for a Matlab function: function [answer] = NewtonForm(m,x,y,z) that inputs • number of data points m; • vectors x and y, both with m components, holding x- and y-coordinates, respectively, of data points; • location z; and uses divided difference tables and Newton form to output the value of the Lagrange polynomial, interpolating the data points, at z. 1. (25 pts) Given the following start for a Matlab function: function [answer] NewtonForm(m.x.yz) that...