I have a .m script file which contains 95% of my work. Part of my assignment was to write a function that performs a certain calculation and then utilize the function for various examples.
I created a separate .m file for the function and named it after the function. I then utilize the function in my main .m script, and everything works fine. I published the .m script and everything looks fine.
However, it does not include my function I created. Since this is part of my work, I need to turn this in along with my main script file. I assume that I need to publish this separately since I do not see a way to include it in the original publication.
Here is my matlab function
%% Function rvm
function [y1,y2] = rvm(x,y)
discr = sqrt((x^2)-(4*y));
y1 = (-x-discr)/2;
y2 = (-x+discr)/2;
end
and here is the error I get when publishing:
Not enough input arguments.
Error in rvm(line 4)
discr = sqrt((x^2)-(y*c));
I haven't used matlab extensively, and it's been a while since then so I am having a little trouble debugging this issue.
I'm confused how this can be giving me an error, since my main script publishes with no errors and utilizes the function fine. Also the syntax seems to be fine...