function c = addtest(a,b)
c = a + 2*b;
When running the script I get the error
Error: only scripts can be source-ed, not functions
When I run the same text from another script I get the error
Error: Function definition unexpected!
--> Error: Undefined function or variable a
Why the different reaction from the different *.m scripts ?
They are in the same location.
Why the errors ?
Dear biplab mukherjee
When running the script addtest.m having the text
c = a + 2*b;
I get the message
Error: only scripts can be source-ed, not functions