Right, first things first.Go and read the instructions, then go back and modify your post (use the "More --> Modify" option to the bottom right of the post) to mark up the code as such so we can examine it conveniently and accurately.If you do not do this, your code may well be meaningless.Note: Also mark up any data in the same way. This includes error output that you get from the IDE. Until you reply and demonstrate that you understand these points that have been made so far, there is absolutely no point working through the other problems with the code, so I will leave it at that for the present.
And there's the point.Code is code, as you might say.
You are more than welcome to help add Matlab code to do what he wants.
Ah, now ...I didn't say that!
Hey, don't shoot the messenger!I'm just giving him hints on how to pose a question in a manner that might even remotely excite some interest by someone else who might know what he is getting at, on the basis that badly presented questions tend to put people off to start with.