I dont know where im going wrong with the code

2 visualizaciones (últimos 30 días)
Daniel Martelli
Daniel Martelli el 11 de Ag. de 2020
Comentada: Daniel Martelli el 11 de Ag. de 2020
adj = 20; % ft
opp = 200; % ft
% pythagorus formula a^2+b^2=c^2
c^2 = adj^2+opp^2;
c^2 = sqrt(ans)

Respuesta aceptada

Sudheer Bhimireddy
Sudheer Bhimireddy el 11 de Ag. de 2020
The left-hand side should be the variable alone. Change that to
c = sqrt(adj^2 + opp^2)
c^2 cannot be the variable name as it has mathematical operator, on the other hand, c2 is a valid variable name.
  2 comentarios
Daniel Martelli
Daniel Martelli el 11 de Ag. de 2020
thankyou
Daniel Martelli
Daniel Martelli el 11 de Ag. de 2020
i fixed it and it worked so thankyou

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Language Fundamentals en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by