Stellar motion part 2, task 5
이전 댓글 표시
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
VISHWANATHAN
2025년 10월 24일
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
2025년 10월 28일
Plz give correct clarification sir... How can i solve..?
답변 (3개)
Cris LaPierre
2023년 6월 1일
편집: Cris LaPierre
2023년 6월 1일
7 개 추천
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
Roni
2023년 8월 12일
thank you very much
Petra
2024년 4월 9일
Same, thanks Chris
Ivan
2024년 12월 21일
Same here. Thanks for the clarification!
VISHWANATHAN
2025년 10월 24일
can you give me ans
VISHWANATHAN
2025년 10월 24일
0 개 추천
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.
카테고리
도움말 센터 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!