当前位置:网站首页>My little idea -- using MATLAB to realize reading similar to ring buffer
My little idea -- using MATLAB to realize reading similar to ring buffer
2022-07-24 05:45:00 【Xiaotao 29】
Recently, a paper reappears , In the article, it is required to buffer the current time and before N − 1 N-1 N−1 A measurement 、 And the corresponding filter variance matrix , I thought of the ring buffer , I wonder if my understanding is accurate , I created a length of N N N The buffer , Then use an index number to correspond to the beginning of the buffer , But as we all know ,MATLAB All numerical data in are stored in a matrix , This makes me want to fit more dimensional matrices , This led to the following attempts , It's very easy to use ! The main method is to use eval Function will :, The dimension of minus one stitching is converted into a command , So as to achieve any dimension N N N Measurements only need to be input , You can output the corresponding values in the correct order .
function bufferValue = readBuffer(buffer, bufferStart)
% buffer The last dimension of is index
colonStr = ':,';
colonNum = ndims(buffer) - 1;
colonJoinStr = repmat(colonStr,[1,colonNum]);
bufferLastDimSize = size(buffer,ndims(buffer));
bufferValue = zeros(size(buffer));
for index = bufferStart:bufferStart+bufferLastDimSize-1
indexTmp = index - (floor((index - 1) / bufferLastDimSize) * bufferLastDimSize);
indexReal = index - bufferStart + 1;
eval(strcat('bufferValue(',colonJoinStr,num2str(indexReal),')','=','buffer(',colonJoinStr,num2str(indexTmp),');'))
end
end
边栏推荐
猜你喜欢

【activiti】流程变量

多商户商城系统功能拆解08讲-平台端商品分类

likeshop单商户SAAS商城系统无限多开

多商户商城系统功能拆解13讲-平台端会员管理

多商户商城系统功能拆解03讲-平台端商家管理

Likeshop100%开源无加密-B2B2C多商户商城系统

多商户商城系统功能拆解11讲-平台端商品栏目

Principle of fusdt liquidity pledge mining development logic system

【mycat】mycat搭建读写分离

The repetition detection function of PHP multi line text content and count the number of repetitions
随机推荐
Brief introduction of [data mining] cluster analysis
【mycat】mycat介绍
Inventory Poka ecological potential project | cross chain characteristics to promote the prosperity of multi track
Oracle数据库的逻辑结构
Hex to RGB
Sunset: noontide target penetration vulnhub
Web3 Foundation grant program empowers developers to review four successful projects
【mycat】mycat搭建读写分离
flink checkpoint配置详解
The project is deployed to the public network for free (intranet penetration)
Logic development analysis of LP dual currency liquidity pledge mining system
国内外知名源码商城系统盘点
多商户商城系统功能拆解10讲-平台端商品单位
推荐一款完全开源,功能丰富,界面精美的商城系统
Substrate 技术及生态6月大事记 | Polkadot Decoded 圆满落幕,黑客松获胜项目为生态注入新生力量
highcharts使用自定义矢量地图
Development technical guide | the most complete technical documents, tutorials and courses of substrate and Polkadot
在 Polkadot 中进行创建的三种方式 —— 平行链、平行线程、智能合约
SqlServer 完全删除
MySQL batch insert demo