what am i doing wrong in this equation?

1 visualización (últimos 30 días)
Muhammad Mubashir Iqbal
Muhammad Mubashir Iqbal el 12 de Jul. de 2022
Respondida: Jan el 13 de Jul. de 2022
solve('sin(y+5)+5*sin(x)+5*cos(5*sqrt(x^2+y^2)+5*cos(x)+5*sin(5*sqrt(x^2+y^2)+5*cos(y)=z',z)))
i am having this error of parentthese and mismatche delimeters
  1 comentario
Jan
Jan el 12 de Jul. de 2022
Whenever you mention an error in the forum, post a copy of the complete message. The details matter.
You are providing an equation, where z is found on one side. Now you want to solve it for z? But this is done already.

Iniciar sesión para comentar.

Respuestas (3)

Jan
Jan el 12 de Jul. de 2022
Editada: Jan el 12 de Jul. de 2022
From the doc of solve:
Support for character vector or string inputs has been removed. Instead, use syms to declare variables and replace inputs such as solve('2*x == 1','x') with solve(2*x == 1,x).
The closing parentheses of "cos(5*sqrt(x^2+y^2)" and "5*sin(5*sqrt(x^2+y^2)" have been moved behind the command. Insert spaces to improve the readability.
syms x y z
solve(sin(y+5) + 5*sin(x) + 5*cos(5*sqrt(x^2+y^2)) + ...
... % ^ missing
... % v missing vv too many
5*cos(x) + 5*sin(5*sqrt(x^2+y^2)) + 5*cos(y) == z, z)
ans = 
  3 comentarios
Muhammad Mubashir Iqbal
Muhammad Mubashir Iqbal el 12 de Jul. de 2022
got it thanx alot
can you also guide how to check its result on a 3d plot using mesh or surf commands
Jan
Jan el 12 de Jul. de 2022
Is it really useful to create this function symbolically? Why do you call solve to solve a function, which is the solution already? What do you want to achieve actually?

Iniciar sesión para comentar.


Muhammad Mubashir Iqbal
Muhammad Mubashir Iqbal el 12 de Jul. de 2022
actually i am trying to see the result of this equation on a 3d plot
it is a equation of datum terrain function
syms x y z
[x, y, z]=meshgrid([0:0.2:4,0:0.2:4]);
solve(sin(y+5)+5*sin(x)+5*cos(5*sqrt(x^2+y^2))+5*sin(5*sqrt(x^2+y^2))+5*cos(y)==z,z);
figure(4)
surf(x,y,z)
i want to see the 3d plot
Error using ^ (line 28)
Arguments must be 2-D. Use POWER (.^) for elementwise power.

Jan
Jan el 13 de Jul. de 2022
There is no need for symbolic calculations or the solve command:
[x, y] = meshgrid(0:0.2:4, 0:0.2:4);
z = sin(y + 5) + 5 * sin(x) + 5 * cos(5 * sqrt(x.^2 + y.^2)) + ...
5 * sin(5 * sqrt(x.^2 + y.^2)) + 5 * cos(y);
surf(x,y,z)

Categorías

Más información sobre Computational Geometry en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by