Stellar motion part 2, task 5
39 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm doing the 5th task of Stellar motion part 2 and I keep getting it marked as wrong.
The solution to the task is
legend(starnames)
and even though I've tried a million ways of reentering it (restarting the task, writing it manually, copying and pasting the solution code), I keep getting a message telling me that "'legend' appears to be both a function and a variable". I can't keep going with the intro if this isn't accepted. Help :(
2 comentarios
VISHWANATHAN
el 24 de Oct. de 2025 a las 10:38
Hint
Use the legend function with one input.
If you get an error from the legend function, check for a variable named legend in the workspace. If this variable exists, clear the variable with clear legend before submitting the task.
Mohammad
el 28 de Oct. de 2025 a las 9:08
Plz give correct clarification sir... How can i solve..?
Respuestas (3)
Cris LaPierre
el 1 de Jun. de 2023
Editada: Cris LaPierre
el 1 de Jun. de 2023
It appears at some point you created a variable named legend, which has overwritten the legend function.
Try adding clear legend before you use legend(starnames)
4 comentarios
VISHWANATHAN
el 24 de Oct. de 2025 a las 10:39
Hint
Use the legend function with one input.
If you get an error from the legend function, check for a variable named legend in the workspace. If this variable exists, clear the variable with clear legend before submitting the task.
0 comentarios
Ver también
Categorías
Más información sobre Legend 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!