I having a problem with my code in MATLAB. In the following code results for r is just a 1x3 matrix. Although inside the while loop r equals to multiple 1x3 matrices. I need r equal to one matrix that is of size 27032x3. So, I just need the multiple r matrices to merge together to get one big matrix. I need that matrix to retain its value outside the while loop as well.   cc=0; % set line counter JD = 2460626.666667;   fid = fopen('tle_catalog.txt'); % load the TLE   tline2='gg'; while ischar(tline2) cc = cc+1; % counter name = fgets(fid);% for the ones with three lines tline1 = fgets(fid); % collect first line of two line elements tline2 = fgets(fid); % collect second line of two line elements   if tline2>0 % stop at the end of the file % initialize the propagation [satrec, startmfe, stopmfe, deltamin] ... = twoline2rv(721, tline1, tline2, 'c', 'd');   time_JD = tline1(21:32); yeardayhour = str2double(regexp(tline1, '(\d{2})(\d{3})(\.\d+)', 'tokens', 'once')); dn = datenum(yeardayhour(1) + 2000, 0, yeardayhour(2), 24 * yeardayhour(3), 0, 0); dt = datetime(dn, 'ConvertFrom', 'datenum'); JD_tle = juliandate(dt);   % how far shall the TLE be propagated [minutes] tsince = JD - JD_tle;   % extract position and velocity [satrec, r, v] = sgp4(satrec, tsince);   end   end   r

Refrigeration and Air Conditioning Technology (MindTap Course List)
8th Edition
ISBN:9781305578296
Author:John Tomczyk, Eugene Silberstein, Bill Whitman, Bill Johnson
Publisher:John Tomczyk, Eugene Silberstein, Bill Whitman, Bill Johnson
Chapter16: Advanced Automatic Controls-direct Digital Controls (ddcs) And Pneumatics
Section: Chapter Questions
Problem 4RQ: A control loop contains _______, _______, and _________.
icon
Related questions
Question

I having a problem with my code in MATLAB. In the following code results for r is just a 1x3 matrix. Although inside the while loop r equals to multiple 1x3 matrices. I need r equal to one matrix that is of size 27032x3. So, I just need the multiple r matrices to merge together to get one big matrix. I need that matrix to retain its value outside the while loop as well.

 

cc=0; % set line counter
JD = 2460626.666667;
 
fid = fopen('tle_catalog.txt'); % load the TLE
 
tline2='gg';
while ischar(tline2)
cc = cc+1; % counter
name = fgets(fid);% for the ones with three lines
tline1 = fgets(fid); % collect first line of two line elements
tline2 = fgets(fid); % collect second line of two line elements
 
if tline2>0 % stop at the end of the file
% initialize the propagation
[satrec, startmfe, stopmfe, deltamin] ...
= twoline2rv(721, tline1, tline2, 'c', 'd');
 
time_JD = tline1(21:32);
yeardayhour = str2double(regexp(tline1, '(\d{2})(\d{3})(\.\d+)', 'tokens', 'once'));
dn = datenum(yeardayhour(1) + 2000, 0, yeardayhour(2), 24 * yeardayhour(3), 0, 0);
dt = datetime(dn, 'ConvertFrom', 'datenum');
JD_tle = juliandate(dt);
 
% how far shall the TLE be propagated [minutes]
tsince = JD - JD_tle;
 
% extract position and velocity
[satrec, r, v] = sgp4(satrec, tsince);
 
end
 
end
 
r
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Refrigeration and Air Conditioning Technology (Mi…
Refrigeration and Air Conditioning Technology (Mi…
Mechanical Engineering
ISBN:
9781305578296
Author:
John Tomczyk, Eugene Silberstein, Bill Whitman, Bill Johnson
Publisher:
Cengage Learning
Automotive Technology: A Systems Approach (MindTa…
Automotive Technology: A Systems Approach (MindTa…
Mechanical Engineering
ISBN:
9781133612315
Author:
Jack Erjavec, Rob Thompson
Publisher:
Cengage Learning
Precision Machining Technology (MindTap Course Li…
Precision Machining Technology (MindTap Course Li…
Mechanical Engineering
ISBN:
9781285444543
Author:
Peter J. Hoffman, Eric S. Hopewell, Brian Janes
Publisher:
Cengage Learning
Principles of Heat Transfer (Activate Learning wi…
Principles of Heat Transfer (Activate Learning wi…
Mechanical Engineering
ISBN:
9781305387102
Author:
Kreith, Frank; Manglik, Raj M.
Publisher:
Cengage Learning
International Edition---engineering Mechanics: St…
International Edition---engineering Mechanics: St…
Mechanical Engineering
ISBN:
9781305501607
Author:
Andrew Pytel And Jaan Kiusalaas
Publisher:
CENGAGE L
Understanding Motor Controls
Understanding Motor Controls
Mechanical Engineering
ISBN:
9781337798686
Author:
Stephen L. Herman
Publisher:
Delmar Cengage Learning