Why Does MATLAB Show an Error When Solving Trigonometric Equations in Degrees?

  • Context: MATLAB 
  • Thread starter Thread starter SaRCaZZM
  • Start date Start date
  • Tags Tags
    Matlab
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 5K views
SaRCaZZM
Messages
1
Reaction score
0

Homework Statement


I need help solving for d, in the really long equation below. However, whenever I insert the following command (see below), I get 'is not a valid equation or expression', but I can't figure out why.


Homework Equations


((cot(104.789d))^2) + (((cot(104.789d))^2)*(1 + (-1.339*(10^-3)))*((sin(209.58d))^2))=-0.3939


The Attempt at a Solution


solve('((cot(104.789d))^2) + (((cot(104.789d))^2)*(1 + (-1.339*(10^-3)))*((sin(209.58d))^2))=-0.3939','d')
 
on Phys.org
SaRCaZZM said:

Homework Statement


I need help solving for d, in the really long equation below. However, whenever I insert the following command (see below), I get 'is not a valid equation or expression', but I can't figure out why.


Homework Equations


((cot(104.789d))^2) + (((cot(104.789d))^2)*(1 + (-1.339*(10^-3)))*((sin(209.58d))^2))=-0.3939


The Attempt at a Solution


solve('((cot(104.789d))^2) + (((cot(104.789d))^2)*(1 + (-1.339*(10^-3)))*((sin(209.58d))^2))=-0.3939','d')

I suppose that when you write cot(104.789d) you really mean cot(104.789*d). The same with the arguments of the other trigonometric functions.
 


1
Ask the user for inputs of the variables start, stop, inc and a. At runtime please enter values of 0, 30, 0.1 and 2, respectively. Plot the equation alt = sin(pi/4) + a•(t-5)2, where a is 2 and t varies from 0 to 30 with a step size of 0.1 in a figure 2. Use an appropriate FOR loop to generate and store the values of t and alt. Add a title, xlabel and ylabel to the plot. Remember to clear at the beginning and pause at the end of the code.


2
For the same “alt” equation above, use a WHILE loop to solve for the time t (starting from 0) at which alt crosses 600 but this time use inc of 0.01 instead of 0.1. Use the command sprintf to create an output message displaying the time at which this occurs (label your answer clearly). Remember to clear at the beginning and pause at the end of the code.