Create a 2d imagesc map to statistic about two arrays and use color to express the intersections of two arrays

2 vues (au cours des 30 derniers jours)
Hello, I have a cell ch_splitB, first column called i and second column called t, third column called rotation. The first task is to combine the first and second column together, and the combination should be 4 digits. Because some digits are just single, and I should put 0 in front of the numbers. For example, ch_split(1,1)=1 and ch_split(1,2)=1, the combination should be 0101. And ch_split(4,1)=1 and ch_split(4,2)=10, the combination should be 0110. I added 0 manually in the variable space but this is complex. Could I have a code that can do this?
The second problem is, after combining column i and t (the new column I called j), I have to statistic about elements with same value. Set a x scale to contain the unique elements of j and set a y scale to contain the unique elements of rotation, and use color to display the number of intersections of x and y. For example, if j=0110 and rotation = 345, and I will calculate how many rows matching this and us color to display this number.
I have searched this many days, and don't know the terms and methods I should use. Thanks.

Réponses (1)

bransa
bransa le 19 Mai 2022
I have written a script to handle your tasks. Let me know if you have any questions

Catégories

En savoir plus sur Colormaps dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by