Don t know how to write formula

  • Thread starter Thread starter johnny_mc
  • Start date Start date
  • Tags Tags
    Formula
AI Thread Summary
The discussion centers around a user's challenge in writing a specific formula in MATLAB. The user seeks assistance with the syntax for their equation, which involves trigonometric functions and square roots. A responder suggests consulting MATLAB's help resources for guidance on writing equations. Key advice includes using only open brackets for functions, writing "arc sin" as "asin," and ensuring multiplication is explicitly indicated with an asterisk (*). Despite following these suggestions, the user reports that their attempt at writing the equation still did not work, indicating ongoing difficulties with the correct syntax in MATLAB.
johnny_mc
Messages
2
Reaction score
0
Hi, i have a problem with MATLAB, i just start to use it, and i desperately need help.
Can anyone help me, how can i wrote this formula :

r[1-cos[arc sin (sqrt(2.*R.*DR+DR.^2)+r sin(arc cos (r-k)/r) /r)]]-k

:smile:
 
Physics news on Phys.org
Hi, you may refer to help in Matlab for writing equations. I can give few points
Matlab accepts only open brackets () and not closed brackets in equations.
write arc sin(x) as asin(x)

Always use * for multiplication of two variables and even with brackets
For example k(x+1)(x+2) as k*(x+1)*(x+2)

Hope this helps
 
hi, i wrote equations like this but it did not help, h = r.*(1-cos(asin((sqrt(2.*R.*DR+DR.^2))+r.*sin(acos(r-k)./r)./r)))-k
 

Similar threads

Back
Top