MATLAB: Facing error in execution need guidance

machine learningtransform

Best Answer

The code in lines 1-10 was a script. Then you came along in lines 11 and 12 and defined a function. Then in line 13 you try to start running the script again by calling the transform function. You can't do that in the same file. If you start off with a script, then everything after that must be a function and each function must conclude with an "end".