Can you please help me how to write this?

1 view (last 30 days)
Hi Everyone,
I would like to have a matrix containing satellites tracked by receivers. So, the first Nsat(r) elements in the rth column correspond to the satellite tracked by the rth receiver.
Can you please help me how to write it?
Thank you,
  1 Comment
Ara
Ara on 28 Jul 2014
I have attached three samples of my data. Example 1 should the output of my first function.

Sign in to comment.

Accepted Answer

Michael Haderlein
Michael Haderlein on 29 Jul 2014
From your three examples I see that the first two columns of amtab are:
>> c1=fix((0:numel(sat)-1)/(size(sat,1)))'+1;
>> am=[c1(sat(:)~=0),sat(sat(:)~=0)]
I cannot say anything about the third column as I don't understand its meaning.

More Answers (1)

Michael Haderlein
Michael Haderlein on 28 Jul 2014
Your question is very difficult to understand as you give 0 details. So I'm just guessing you have some function which gives you the satellites of a specific receiver. Then it could read like
for cnt=1:length(receivers)
temp_sat=getsatellites(receivers(cnt));
sat(1:length(temp_sat),cnt)=temp_sat;
end
For your future questions, please follow this guideline (<http://www.mathworks.de/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer)>.
  2 Comments
Ara
Ara on 28 Jul 2014
Thank you, Michael Haderlein. Yes, right on you. To be honest, this is the third time I edited my question, and yes I should have given more details.
I have some more questions so let me please provide you more details, and then ask my questions if you do not mind.
Actually, I am writing a function as follows,
function amtab = Firstexample(sat, Nsat, Nrec)
% Input:
% Nrec:Number of Receivers. Must be a scalar.
% Nsat:Number of satellites. Vector of Nrecx1.
% sat: Number of PRNs tracked by receivers.
Nrec = 3;
Nsat = [4;4;4];
sat = [1 1 1;2 2 2;3 3 3;4 4 4];
% Output:
% The output named "amtab", where three receivers each tracked four
% satellites so the ambiguity based on S-basis theory
% each satellite and receiver has to be presented exclusively by one of the ambiguities in the
% S-basis, with the exception of one ambiguity that represents both a
% receiver and a satellite. Then should be a matrix of 12x3.
Here "sat" is is a matrix containing satellites (e.g., PRNs) tracked by the receivers. The first "Nsat(r)" elements in the rth column correspond to the satellite PRNs tracked by the rth receiver.
The "output" is "ambtab" is a matrix of "Namb" ×3, where "Namb" is the number of ambiguities. Each row corresponds to a ambiguity with the first element (column) referring to the receiver, the second element (column) referring to the satellite PRN, and the third element (column) indicating whether the ambiguity belongs to S-basis (zero) or belongs to estimable set (one).
I am trying to write a function for this scenario.
It would be great if you give me some hints in order to solve it.
Thank you,
Michael Haderlein
Michael Haderlein on 28 Jul 2014
I have no idea about this S-basis thing and I don't understand what you mean with ambiguity. Please provide an example which is clear even for people who don't work with satellites. Or, even better, check if the function "unique" and/or the related ones can help you.

Sign in to comment.

Categories

Find more on Reference Applications in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!