Borrar filtros
Borrar filtros

how to solve equations ?

4 visualizaciones (últimos 30 días)
Kanav Vij
Kanav Vij el 25 de Jun. de 2015
Respondida: Karam Daher el 2 de Mayo de 2021
I want to solve equations sin(x) and straight line y=0.5, in a specified domain, for example: I want to solve y=sin(x) and y=0.5 in domain 0<x<360, and get the intersecting points.

Respuesta aceptada

Mischa Kim
Mischa Kim el 25 de Jun. de 2015
Editada: Mischa Kim el 25 de Jun. de 2015
Symbolically,
syms x
solve(sin(x) - 0.5 == 0,x)
ans =
pi/6
(5*pi)/6
Numerically,
myfun = @(x) sin(x) - 0.5;
fsolve(myfun,0) % guess: 0
ans =
0.523598768728013
For other numeric solutions you need to adjust the guess value.
  1 comentario
Kanav Vij
Kanav Vij el 26 de Jun. de 2015
Editada: Kanav Vij el 26 de Jun. de 2015
thanks mischa for your answer,but when writing the above I,m getting error
??? Error using ==> char Conversion to char from logical is not possible.
Error in ==> solve>getEqns at 169 vc = char(v);
Error in ==> solve at 67 [eqns,vars] = getEqns(varargin{:}); Also can you tell me if I want to specify a range such as 0<x<720 or bigger. I'm trying to use assume(0<=x<=720), but there is error coming
??? Error using ==> sym.sym>notimplemented at 2514 Function 'le' is not implemented for MuPAD symbolic objects.
Error in ==> sym.sym>sym.le at 825 notimplemented('le');
I'm using matlab 7.10.0 (R2010a)

Iniciar sesión para comentar.

Más respuestas (1)

Karam Daher
Karam Daher el 2 de Mayo de 2021
Write a program that finds the smallest even integer that is divisible by 13 and by 16 whose square root is greater than 120. Use a loop in the program. The loop should start from 1 and stop when the number is found. The program prints the message “The required number is:” and then prints the number.

Community Treasure Hunt

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

Start Hunting!

Translated by