How to store data into a matrix?
显示 更早的评论
I'm calculating Zerocross (ZCR) and Short term energy (STE) for a signals in a matrix. After I calculate these features I want to store results into one matrix F to contain both features STE and ZCR, like this :
F=[STE1][ZCR1]
[STE2][ZCR2]
[STE3][ZCR3]...
B is 1x59 cell array which cells are matrixes B = {[240x1], [480x1],[960x1] ...} so each cell is another matrix.
So I want my output to be like this
F = [240x1][ZCR1]
[480x1][ZCR2]
[960x1][ZCR3] ...
% first column (e.g.[240x1]) is STE calculation of the first column in B, and second column is a calculation of the Zerocross also of the first column of the cell array B..and so on
How can I get that output? My code is next:
for i=1:length(V)
V=B{1,i}
%zerocross
zcd = dsp.ZeroCrossingDetector;
numZeroCross = step(zcd,V)
ZER{i}=numZeroCross %output for zerocross
%short term energy
winLen=length(V)
energyST = sum(V.^2,winLen)
EN{i}=energyST %output for STE
end
2 个评论
Jan
2017-3-13
Matrix B is 1x59 cell array which looks like this
B = {[240x1], [480x1],[960x1] ...} so each cell is a matrix.
This is not easy to understand. What is "B"? If B is a "matrix", it is not a "cell vector". What is the relation between "B" and the shown "F"? What exactly does "[240x1,ZCR1]" mean? What is "ZCR1"?
Lara Lirnow
2017-3-13
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!