matlab中for创建矩阵,每次for循环生成一个固定行列的矩阵,把每次矩阵存到。......

这段代码展示了如何在MATLAB中使用for循环创建矩阵,并进行GPS信号跟踪。代码中更新GUI状态,读取数据块,进行码相位跟踪,并计算载波和码元误差,用于调制解调过程。
摘要由CSDN通过智能技术生成
        for loopCnt =  1:codePeriods

%% GUI update -------------------------------------------------------------

% The GUI is updated every 50ms. This way Matlab GUI is still

% responsive enough. At the same time Matlab is not occupied

% all the time with GUI task.

Ln=sprintf('\n');

trackingStatus=['Tracking: Ch ', int2str(channelNr), ...

' of ', int2str(settings.numberOfChannels),Ln ...

'PRN: ', int2str(channel(channelNr).PRN),Ln ...

'Completed ',int2str(loopCnt), ...

' of ', int2str(codePeriods), ' msec',Ln...

'C/No: ',CNo,' (dB-Hz)'];

if (rem(loopCnt, 50) == 0)

try

waitbar(loopCnt/codePeriods, ...

hwb, ...

trackingStatus);

catch

% The progress bar was closed. It is used as a signal

% to stop, "cancel" processing. Exit.

disp('Progress bar closed, exiting...');

return

end

end

%% Read next block of data ------------------------------------------------

% Find the size of a "block" or code period in whole samples

% Update the phasestep based on code freq (variable) and

% sampling frequency (fixed)

codePhaseStep = codeFreq / settings.samplingFreq;                %%%  settings.samplingFreq       =

5.714e6;  %[Hz]

blksize = ceil((settings.codeLength-remCodePhase) / codePhaseStep);   %%%settings.codeLength

= 1023;  remCodePhase  = 0.0;                             %%%初始码移位为0

% Read in the appropriate number of samples to process this

% interation

[rawSignal, samplesRead] = fread(fid, blksize, settings.dataType);  %%%  settings.dataType

='int8';

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值