Your first non-comment line is
function [eco1, eco2, ag2, eco3, ag3, eco4, ag4, eco5, ag5, eco6, eco7, P] = fcn (TX, TY, TZ, RX, RY, RZ, CX, CY, CZ)
This declares a function named "fcn". You need to store that in a file named fcn.m
When you run the function from the command prompt, you need to provide parameters to run it with. For example,
>> fcn(rand(), rand(), rand(), rand(), rand(), rand(), rand(), rand(), rand())
Best Answer