Question: I really need help in solving this matlab program calling hwk1prob1 using the script and I need a lot help in using matlab to solve

 I really need help in solving this matlab program calling hwk1prob1

using the script and I need a lot help in using matlab

I really need help in solving this matlab program calling hwk1prob1 using the script and I need a lot help in using matlab to solve this problem using matlab. I tried using function with the script hwk1prob1 and I wrote a program that does not work in matlab because I keep getting the same errors such as undefined function,not enough input arguments. It is important in this assignment to create a hwk1prob1.m that does not expect any input, and which determines its own x value to pass as the second parameter to fsolve() .

1. The matlab function fun1.m defines a function f:R2R. Write a matlab program called hwk1prob1.m that uses the matlab function fsolve to solve the equation f(r) 0. Run your program, outputting your solution to the file hwk1out1.txt o Hints/suggestions To get help on using the fsolve function, type "help fsolve" at the matlab command prompt. To use fsolve, you will need to give a starting point x0, which represents an initial guess for the solution. You may need to try multiple starting points to find one that works .A simple way to generate your output file is to type "diary hwk1out1.txt" at the matlab command line and then run your program. function [ y ] -fun1(x) funl (x) evaluates the function f: R*2 - RA2 defined by f (x) - [f1 (x1, x2), f2 (x1, x2)] where f1 (x1, x2)tanh (2x1-3x2+1) f2(x1,x2) = exp (. 3x1+ .4 x2 )-4.7 % input x = vecto r of length 2: x=[x1, x2 ] % output y (fl (x) ,f2 (x)) -tanh (2*x ( 1 )-3*x (2)^2) +1; y(1) y(2) exp ( . 3tx ( 1 ) +.4*x (2))-4.7: end 1. The matlab function fun1.m defines a function f:R2R. Write a matlab program called hwk1prob1.m that uses the matlab function fsolve to solve the equation f(r) 0. Run your program, outputting your solution to the file hwk1out1.txt o Hints/suggestions To get help on using the fsolve function, type "help fsolve" at the matlab command prompt. To use fsolve, you will need to give a starting point x0, which represents an initial guess for the solution. You may need to try multiple starting points to find one that works .A simple way to generate your output file is to type "diary hwk1out1.txt" at the matlab command line and then run your program. function [ y ] -fun1(x) funl (x) evaluates the function f: R*2 - RA2 defined by f (x) - [f1 (x1, x2), f2 (x1, x2)] where f1 (x1, x2)tanh (2x1-3x2+1) f2(x1,x2) = exp (. 3x1+ .4 x2 )-4.7 % input x = vecto r of length 2: x=[x1, x2 ] % output y (fl (x) ,f2 (x)) -tanh (2*x ( 1 )-3*x (2)^2) +1; y(1) y(2) exp ( . 3tx ( 1 ) +.4*x (2))-4.7: end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!