please solve then upload matlab code
Thanks
Q1.
Q2.
Here the fminsearch function is used and the minimum values are stored in the column vector z.
please solve then upload matlab code Thanks 1. The function f(z, y) (a-x)2 + b(y-12)2 is...
2) Use the function h(x,y)= as follows: 1+x2+y2+x+xy 2 2D optimization utilizing Excel · Produce a surface plot of the function Utilize Solver to find the optimum value o o 2D optimization utilizing Matlab o o o Produce a surface plot the function Produce a contour plot of the function Utilize fminsearch to find the optimum value
Creat a matlab function that calculates: f(x, y) = xy/(exp(x) + exp(-y)) for two vectors of values x and y. Name your function function_xy: The inputs should be in the same order: .X: vector of values • y: vector of values The ouput is: • A: is the calculated array f(x,y) Function 1 function (Outputs] = YourFunctionName(Inputs) 2 % Input code here end Code to call your function 1 X=-4:0.5:4 2 y=-5:1:5 4 A = function xy(x,y)
Please provide the matlab code solution for this problem. Exercise 2 Consider the differential equation for the Van der Pol oscillator (use ode45) which has a nonlinear damping term a (y -1) y 1. For E 0.25, solve the equation over the interval 0,50 for initial conditions y (0) 0.1 and y' (0) -1. TASK: Save y as a column vector in the file A04.dat TASK: Save y' as a column vector in the file A05.dat 2. For a 10,...
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...
code in Matlab Problem 1: The MATLAB humps function defines a curve that has 2 maxima (peaks) of unequal height over the interval 0 2, f(x) = r-0.3)2 +0.01 (r-09 +0.04 Use MATLAB to generate a plot of Kx) versus x with x [0:1/256:2: Do not use MATLAB's built-in humps function to generate the values of Rx). Also, employ the minimum number of periods to perform the vector operations needed to eneate x) values for the plo Problem 1: The...
Please use MatLab and comment code. Problem 2 Write a MATI AB user-defined function y-M?SotxType): x is a vector containing numbers. and Type can be 'Ascending' or Descending'. This function should sort the given vector x in the ascending or descending order based on the user's request and return the desired vector as the output. Do not use MATLAB built-in function sort. Hint: When you call this function you need to use for Ascending or Descending since they are strings.
Write MATLAB code g(x)=x+a*f(x) f(x)=(e^x)+(x^2)-x-4 function f(x) is stored in fogp1.m (c) (1) Create a file gopgi.m to calculate the function glir, a) (see Preparation, ex. 7c) function [y] =gopg1(x,a) % input: x, a % output: y y= .....; (2) Create a file sucsub1.m and write a program that calculates the solution using the method of successive substitution. Calculate the values of g(x, a) by making multiple calls to the function gopg1(x, a). Take xo = 1.3 as starting value...
Consider the function f(x) = x3 – 2x2 + x Write the MATLAB code in the format of "script file" using "Regula Falsi Method" with the estimated relative error of 0.000001 and upload the script file. Direction: 1) Please submit"script file", NOT "function file". If you submit a function file, I will assign ZERO score. 2) You can find some matlab code for the Regula Falsi Method on a web or some books. You can use any code you can...
please solve in matlab 1[35p) Write a user-defined MATLAB function that determines the unit vector in the direction of the line that connects two points (A and B) in space. For the func- tion name and arguments, use n = unitvec (A,B). The input to the function are two vectors A and B, each with the Cartesian coordinates of the corre- sponding point. The output is a vector with the components of the unit vector Join the direction from A...