I have thoroughly looked around to try figuring out a way to create a matlab like struct array in python. There are some questions online that I looked at and either the answers don't seem to help or I might simply be misinterpreting them as they pertain to me. So, moving on. I am trying to form a python equivalent to the following matlab code.
channel = [];
channel.PRN = 0;
channel.acquiredFreq = 0;
channel.codePhase = 0;
channel.status = '-';
channel = repmat(channel, 1, settings.numberOfChannels);
Where repmat would basically create a struct array called channel with a number of cells equal to settings.numberOfChannels and each of those would have PRN,acquiredFreq, etc.
Later on, I access this struct by performing a loop that alters these values as such:
for ii = 1:settings.numberOfChannels
channel(ii).PRN = PRNindexes(ii);
channel(ii).acquiredFreq = acqResults.carrFreq(PRNindexes(ii));
channel(ii).codePhase = acqResults.codePhase(PRNindexes(ii));
I have tried several approaches but it either spits out nonsense in the case of tile using numpy(which i might have just been using incorrectly) or when I attempt to make a loop such as:
class test:
for iii in range(1,settings.numberOfChannels):
iii.PRN=0
iii.acquiredFreq=0
iii.codePhase=0
iii.status="-"
More than likely I suppose it's a syntax error or my misunderstanding of python since this is my first time utilizing it. If this is the incorrect place to ask this or something of that nature, I apologize.
Thank you