Local functions are not working in MatLab R2022a
I’m trying to write local functions in the way instructed in this video: https://www.youtube.com/watch?v=f0zKcuP3Wc0&list=PLlvaivyRxHmdTvpNBe4gKWrOBrcuxhpsl&index=48, beginning at 5:50. When running the code below, my MatLab R2022a says Unrecognized function or variable ‘mymean’. What am I missing here?
x = 1:10;
n = length(x);
avg = mymean(x,n)
function a = mymean(v,n)
a = sum(v)/n;
endI’m trying to write local functions in the way instructed in this video: https://www.youtube.com/watch?v=f0zKcuP3Wc0&list=PLlvaivyRxHmdTvpNBe4gKWrOBrcuxhpsl&index=48, beginning at 5:50. When running the code below, my MatLab R2022a says Unrecognized function or variable ‘mymean’. What am I missing here?
x = 1:10;
n = length(x);
avg = mymean(x,n)
function a = mymean(v,n)
a = sum(v)/n;
end I’m trying to write local functions in the way instructed in this video: https://www.youtube.com/watch?v=f0zKcuP3Wc0&list=PLlvaivyRxHmdTvpNBe4gKWrOBrcuxhpsl&index=48, beginning at 5:50. When running the code below, my MatLab R2022a says Unrecognized function or variable ‘mymean’. What am I missing here?
x = 1:10;
n = length(x);
avg = mymean(x,n)
function a = mymean(v,n)
a = sum(v)/n;
end function MATLAB Answers — New Questions