The function may be unused
Show older comments
I'm now learnign to use MatLab and I'm not sure where I went wrong.
function ave=myaverage(x,N)
sizex=size(x);
sizeN=size(N);
if sizex(2)>sizeN(2)
beep
disp('Error')
else
total=sum(N);
s=x.*N;
ave=sum(s)/total
end
end
I encounter several errors when creating the finction:
- The function "myaverage" may be unused
- unable todefine the local function "myaverage" because it has the same name as the file.

Also when calling the function, i encountered as error:
i. Function with duplicate name "myaverage" cannot be defined.

1 Comment
darova
on 1 May 2020
Please attach the code
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!