How do I call an external function in Cody Coursework?
3 ビュー (過去 30 日間)
古いコメントを表示
Francisco Rullan
2018 年 1 月 10 日
コメント済み: Francisco Rullan
2018 年 1 月 14 日
I am developing an assignment for my students in Cody Coursework.
I would like them to implement a function "f" that calls another function "g" given by me. The code for "f" would be
function [value] = f(a, b)
...
% Call g
g(a, b)
...
end
I want Cody Coursework to have access to the implementation of "g" and use it in function "f" when called.
0 件のコメント
採用された回答
Sharan Paramasivam Murugesan
2018 年 1 月 12 日
You can implement this function g() in a file, say, g.m and upload it in "Files Referenced" when creating a problem within the assignment.
5 件のコメント
Jan
2018 年 1 月 13 日
編集済み: Jan
2018 年 1 月 13 日
"sum" is a bad choice as name, because this is a builtin function. Maybe "sum" is used internally for the evaluation of the result and shadowing this function causes serious troubles.
Your code does not even try to call your function sum. So why do you assume that the call of the external function is the problem? It seems like your current problem is to submit a test problem and does not concern the original question. Such changes of the problem during the discussion are confusing.
Did you select the Problem Type "function" instead of "script"? I do not know if "reference.f" is correct, because I avoid working with Cody or Code Coursework.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Event Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!