So as you know, it is really hard to troubleshoot a Matlab program, especially when you do not have access to the program. So can you please upload your simulation file along with the program you have written? As this erro might have something to do with the format of the vectors you have formed by Matlab. Thank you.