MATLAB: Combining multiple M-files

berofdmpaprsnrurgent

How do I combine 3 m-files?
Run the m-files in the sequence files enumerated below.
  1. is to modulate a BPSK signal
  2. is to add AWGN
  3. is to detect and calculate BER

Best Answer

Simply call them one right after the other
>> File1,File2,File3
.
.
.
EDIT Updated in response to an email from Sherif...
I looked at the files, found here for anyone else who is interested. These are scripts, and horribly named at that. The first thing you have to do is rename them so that the number is at the end of the name, not the beginning, as MATLAB doesn't recognize names like 1myfile. Change it to myfile1.
Then, looking at the code, we find horrific coding practices, not the least of which is growing huge arrays in FOR loops. Thus the files are very slow. Finally, the second file (or what we can only guess is the second file by the 2) calls a function AWGN, which I don't have. It turns out that this file is part of the communications toolbox, which is not listed as a requirement (go figure). If I had this file, I think the code would run.
So, if you have the communications toolbox, rename the files as I did, then call them one after the other. Though judging by the terrible coding practices, I would not guarantee any outcome whatsoever.