how to assemble a symbolic series?

1 vue (au cours des 30 derniers jours)
Abuh La Ha NedaL
Abuh La Ha NedaL le 17 Juin 2022
Commenté : Star Strider le 20 Juin 2022
Hello everyone, I would like to implement the logic described in the figure below. It is one of the steps necessary for converting a time series into a symbolic series. The image is an explanation of how the logic works, in this case the partition length is l=12. Any help is welcome, thanks for your attention.

Réponses (2)

Star Strider
Star Strider le 17 Juin 2022
Try something like this —
b = randi([0 1], 1, 12)
b = 1×12
0 1 0 0 1 1 0 1 0 1 1 1
for k = 1:7
sb(k,:) = b(k:k+5);
end
sb
sb = 7×6
0 1 0 0 1 1 1 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1 0 1 1 1
bc = mat2cell(sb,ones(7,1),6)'
bc = 1×7 cell array
{[0 1 0 0 1 1]} {[1 0 0 1 1 0]} {[0 0 1 1 0 1]} {[0 1 1 0 1 0]} {[1 1 0 1 0 1]} {[1 0 1 0 1 1]} {[0 1 0 1 1 1]}
That is as close as I can get to the result in the illustration.
.
  25 commentaires
Abuh La Ha NedaL
Abuh La Ha NedaL le 20 Juin 2022
I really appreciate your help Star, it really is a more complex problem. The part of the initial logic you solved well.
Star Strider
Star Strider le 20 Juin 2022
My pleasure!

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 19 Juin 2022
In the case where what you care about is the decimal output, and not how it is arrived at, then:
b = [0 1 0 1 1 0 0 0 0 1 1 1 0]
b = 1×13
0 1 0 1 1 0 0 0 0 1 1 1 0
results = conv(b, 2.^(0:5), 'valid')
results = 1×8
22 44 24 48 33 3 7 14
crosscheck = [0b010110, 0b101100, 0b011000]
crosscheck = 1×3
22 44 24

Catégories

En savoir plus sur Denoising and Compression dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by