Cody

Problem 43330. Solve expression III

Solution 3838998

Submitted on 25 Nov 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = 2:4; y_correct =(tan(2.*x.^2+7.*x-30.25)+log(x.^3-2.25))./(nthroot(sin(x.^3).^2+1/5*log(x.^4-2.5),3)); assert(isequal(your_fcn_name(x),y_correct))

Error using ^ (line 51) Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'. Error in your_fcn_name (line 2) y = (tan(2*x.^2+7*x-30.25)+log(x.^3-2.25))/(nthroot(sin(x.^3)^2+1/5*log(x.^4-2.5)*3)); Error in Test1 (line 3) assert(isequal(your_fcn_name(x),y_correct))

2   Fail
x = 6; y_correct =(tan(2.*x.^2+7.*x-30.25)+log(x.^3-2.25))./(nthroot(sin(x.^3).^2+1/5*log(x.^4-2.5),3)); assert(isequal(your_fcn_name(x),y_correct))

Not enough input arguments. Error in nthroot (line 15) if ~isreal(x) || ~isreal(n) Error in your_fcn_name (line 2) y = (tan(2*x.^2+7*x-30.25)+log(x.^3-2.25))/(nthroot(sin(x.^3)^2+1/5*log(x.^4-2.5)*3)); Error in Test2 (line 3) assert(isequal(your_fcn_name(x),y_correct))

3   Fail
x = 30:2:40; y_correct =(tan(2.*x.^2+7.*x-30.25)+log(x.^3-2.25))./(nthroot(sin(x.^3).^2+1/5*log(x.^4-2.5),3)); assert(isequal(your_fcn_name(x),y_correct))

Error using ^ (line 51) Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'. Error in your_fcn_name (line 2) y = (tan(2*x.^2+7*x-30.25)+log(x.^3-2.25))/(nthroot(sin(x.^3)^2+1/5*log(x.^4-2.5)*3)); Error in Test3 (line 3) assert(isequal(your_fcn_name(x),y_correct))

Suggested Problems

More from this Author37

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!