I am using matlab to solve the below equation to obtain x. Can matlab solve 3 order equation including square root of the. B sqrtx returns the square root of each element of the array x. Because these numbers are not symbolic objects, you get floatingpoint results. This matlab function returns the square root of each element of the array x. Real nth root of real numbers matlab nthroot mathworks. This matlab function returns the principal square root of the matrix a, that is, xx. For the elements of x that are negative or complex, sqrtx produces complex results.
If your question is really how to compute the cube of the square root as you said but not what you wrote, that is even easier. Nth root of symbolic numbers matlab nthroot mathworks. Include an annotation of the equation for the fit line. Download the latest matlab and simulink product updates from the mathworks download center. If an element in x is negative, then the corresponding element in n must be an odd integer. Y nthrootx,n returns the real nth root of the elements of x. Y nthroot x,n returns the real nth root of the elements of x. All the symbols are latex compatible, which is great, and you can make plots like this. After you obtain the polynomial for the fit line using polyfit, you can use polyval to evaluate the polynomial at other points that might not have been included in the original data compute the values of the polyfit estimate over a finer domain and plot the estimate over the real data values for comparison. Download matlab, simulink, stateflow and other mathworks.
In matlab, you can perform calculations within the square brackets. Sqrt can be evaluated to arbitrary numerical precision. How to tell matlab to give real cube roots instead of complex ones. The sqrt functions domain includes negative and complex numbers, which can lead. The sqrt functions domain includes negative and complex numbers, which can lead to unexpected results if used unintentionally. Particular cases nthrootx,n if n is a scalar, scilab nthroot is equivalent to matlab nthroot if n is not a scalar, scilab nthroot calculates the elementwise real nth root. Both x and n must be real scalars or arrays of the same size. Sqrt a b is not automatically converted to sqrt a sqrt b. For the elements of x that are negative or complex, sqrt x produces complex results. Based on your location, we recommend that you select. B sqrt x returns the square root of each element of the array x. Compute three solution for cube root including imaginary number.