フィルターのクリア

在使用Matlab Grader时,系统​检测我的答案时显示U​nable to resolve the name‘refer​enceVariab​les.y1’(这是​一个系统内部的变量)

5 ビュー (過去 30 日間)
立强
立强 2023 年 3 月 16 日
回答済み: Swaraj 2023 年 4 月 6 日

我在使用Matlab Grader时,系统要对我的变量正确性用assessVariableEqual进行检验。
代码输入后系统显示Unable to resolve the name‘referenceVariables.y1’(这是一个系统内部的变量)。
我想问一下这是什么原因导致的?该如何解决?
When I use Matlab Grader, the system will test the correctness of my variables with assessVariableEqual.
After input, the system displays Unable to resolve the name 'referenceVariables.y1' (an internal variable).
I would like to ask what is the cause of this? How to solve it?

回答 (1 件)

Swaraj
Swaraj 2023 年 4 月 6 日
Hi,
I understand that you are getting an error “Unable to resolve the name 'referenceVariables.y1'”. I tried to understand the reasons for this error.
The error message “Unable to resolve the name 'referenceVariables.y1'” shows up when you are trying to use a variable which is not yet defined. Make sure you are using the exact name of the variable as intended. Also take care of the scope rules of the variable defined. Like scenario where you have defined a variable in an “if” condition and using it after the “if” condition ends. Here, if the condition fails, the variable will not be defined.
To understand more, you can go through the following answer.
I hope it helps.
Thanks!!

カテゴリ

Help Center および File ExchangeMATLAB 快速入门 についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!