Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

What is wrong with this code?

1 visualización (últimos 30 días)
matlabnoob
matlabnoob el 18 de Feb. de 2019
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I am new to Matlab, which is probably very apparent from the above picture. I am trying to display that the left side of the equation on line 4 is equal to the function on the right after the n and x have been defined by the user. Any help would be much appreciated. Thanks!

Respuestas (2)

madhan ravi
madhan ravi el 18 de Feb. de 2019
Editada: madhan ravi el 18 de Feb. de 2019
Remove the single quotes from the last line, upload the code instead of a picture.
a/rw^2 == (cos(x)+(n^2*cos(2*x)+sin(x)^4))/((n^2-sin(x)^2)^(3/2))
% ^-^---------^-^------^-^^^------------^-^-- see the changes
You can simply use isequal() to compare if they are the same.
Note: You should define rw as a number like x and n.

KSSV
KSSV el 18 de Feb. de 2019
Editada: KSSV el 18 de Feb. de 2019
'a/rw^2'==
The above is completely wrong........variable shoould be simply:
a = your expression
There are lot of typos...you need to use something like below:
a = (cos(x)+(n^2*cos(2*x)+sin(x)^4))/((n^2-sin(x)^2)^(3/2))

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by