Calling a "hidden" function in octave

Re: Calling a "hidden" function in octave

by Ana Ferraz -
Number of replies: 2
Thank you Richard for the prompt reply. I have tried both options and they work fine for function type of questions.
I wanted the student to write a full script not a function, and in this script use a hidden function (that might contain lines of code that the student haven't learned yet for example).
It seems that when I try to do this I get the message: "Parse error: expected line starting with "function". Is this valid code?"
In reply to Ana Ferraz

Re: Calling a "hidden" function in octave

by Richard Lobb -
If you're not too worried about the possibility that a sufficiently smart student can see the code of your function (by reading the current working directory) you should be able to just drop the .m file containing the function into the Support Files section of the question author form. All support files are copied into the current working directory on Jobe when the program runs, so MATLAB should just load it automatically when it's called, shouldn't it? Give it a go and let me know if it doesn't work. [I haven't used MATLAB for several years and I might be mis-remembering.]
In reply to Richard Lobb

Re: Calling a "hidden" function in octave

by Ana Ferraz -

It works, that's exactly what I needed. I will explore more the support files sections too

The function is "hidden" because is has complicated calculations that is not required for the students to know at this point. It's not a big issue if the student can see the code. So this works well, thank you.