フィルターのクリア

MATLAB Fundamentals course problem

14 ビュー (過去 30 日間)
Nicholas Caputo
Nicholas Caputo 2017 年 11 月 11 日
コメント済み: Chaitanya Chitale 2017 年 11 月 16 日
Hi, I have a problem in this course in this part: "5.11 Reshaping Arrays: (7/8) Overall Average Electricity Revenue" for task 1. I receive an error message even if my answer is correct. It doesn't find the variable named avgRev. Can anyone help me? Thanks, Nicholas
  2 件のコメント
Image Analyst
Image Analyst 2017 年 11 月 11 日
Probably . . . if you give us your code!
But read this link first.
Chaitanya Chitale
Chaitanya Chitale 2017 年 11 月 16 日
This issue is now fixed.

サインインしてコメントする。

採用された回答

Chaitanya Chitale
Chaitanya Chitale 2017 年 11 月 13 日
編集済み: Chaitanya Chitale 2017 年 11 月 13 日
This is a bug in certain practice problems in the MATLAB Fundamentals and the Machine Learning with MATLAB courses caused by the use of the function boolean in the grading code. This function is only available in Simulink which is not available in the online course environment.
We are working on fixing the bug as soon as possible.
As a workaround, please add the following line of code at the top of the MATLAB script before submitting:
boolean = @logical;
  1 件のコメント
Nicholas Caputo
Nicholas Caputo 2017 年 11 月 13 日
It works. Thank you so much!

サインインしてコメントする。

その他の回答 (3 件)

Jan
Jan 2017 年 11 月 11 日
Can anyone help me?
Yes. Or no. It depends on what kind of help you want.
The error message is clear already: It is tried to use the variable "avgRev", but it has not been created before. The message contains the line, where the code fails. Open it in the editor and find out, where you have to provide this variable or where to create it. Perhaps it is a typo only.
For a more specific help, we need the (relevant part of the) code, the complete error message and the code you use for calling this function (or do you use the "Run" icon in the editor?).
  7 件のコメント
gs
gs 2017 年 11 月 12 日
編集済み: gs 2017 年 11 月 12 日
Task 2 can't be enabled without passing Task 1. I think the bug is the use of "boolean" instead of "isboolean" in the assert command in the test suite. I attach a screenshot of the test suite details.
Jan
Jan 2017 年 11 月 13 日
isboolean is not useful here, because exist replies a double with an integer number. Try to define boolean as in a dummy in the code:
boolean = @(x) x

サインインしてコメントする。


gs
gs 2017 年 11 月 12 日
編集済み: gs 2017 年 11 月 13 日
I've encountered a similar bug in part: "6.1 Project - Halfway Review of Fundamentals: (2/3) Women's 200m Backstroke". I attach the code of the test suite details:
t1__ = (boolean(exist('name')))
t2__ = (boolean(exist('country')))
t3__ = (boolean(exist('time')))
assert(t1__ && t2__ && t3__)
  1 件のコメント
Nicholas Caputo
Nicholas Caputo 2017 年 11 月 12 日
I have the same problem here too.

サインインしてコメントする。


Walter Roberson
Walter Roberson 2017 年 11 月 13 日
編集済み: Walter Roberson 2017 年 11 月 13 日
In another related Question, Mathworks said it is a bug that they will repair ASAP.
Unfortunately I cannot find that question now to make sure they know to look at all the various chapters.

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by