Try sind, or atan2d for the degree versions of sin and atan2, respectively. While you could in theory compute e and then use the power operator ( in matlab) to raise e to that power accordingly, this is in fact a less precise way of calculating the exponential function, and therefore matlab provides the exp function for that purpose. Your version will probably produce a more diverse set of outputs. MATLAB conveniently defines versions of the common trig functions which take and produce values in degrees. Where the final line is the shortest representation found from the previous list, that would be your single return value. They automatically do the degree to radian, and return the value is if you passed in the value in radians. These are modifyed sine, cosine, tangent, secant, cosecant, and cotangent functions which take their argument in degrees. > fun = symfun(sin(T+fi)+cos(T+fi),) Ĭos(T)*cos(fi) - sin(T)*sin(fi) + cos(T)*sin(fi) + sin(T)*cos(fi)Įxp(- T*i - fi*i)*(1/2 + i/2) + exp(T*i + fi*i)*(1/2 - i/2) The six standard trig functions modified to take arguments in degrees. Predictive Maintenance, Part 5: Digital Twin. Anyway, here's the output from this now-gone function from R2012b, which might give you hints regarding more low-level functions to try: > syms T fi t real Jacobi method ninput( Enter number of equations, n: ) A zeros(n,n+1) x1 zeros(n) x2 zeros(n). However, as pointed out, this function has been deprecated and no longer available after 2015a. The input to the trig function block is the. I would solve it as: sin (t)/cos (t) -7/5 and I would find it as arctan (-7/5) -0.9505. can be found in math operations under trigonometric function. 2 I'm trying to solve for t trigonometric equations in Matlab, as i.e. I originally suggested that you try simple, which by default (with 0 output variables) will try a bunch of various simplification attempts, and tell you the result. Functions such as sine, cosine, tangent, etc. The above output is again from R2012b, it's highly likely that your newer version will do better. If you're specifically looking for an expression in terms of sines, you could try rewrite: > rewrite(fun,'sin') Still: it's hard to come up with a specific simplification of a symbolic expression, especially if trigonometric functions are involved. In R2012b simplify gives me cos(T + fi) + sin(T + fi) Example 1: Matlab Matlab code for InLine function sqrt (36) log (exp (1)) Output: User Defined Inline Functions: MATLAB provides the option to define inline functions in the script using the inline keyword.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |