Info

This question is closed. Reopen it to edit or answer.

How to automate the process of getting the values in a 35x35 dataset based on some rules?

1 view (last 30 days)
states = {'000010', '100010', '200010','110010', '210010', '001010', '101010', '201010', '011010', '111010', '211010', '002010', '102010', '202010', '012010', '112010', '212010', '000110', '100110', '200110', '010110', '110110', '210110','001110', '101110', '201110', '011110', '111110', '211110', '002110', '102110', '202110', '012110', '112110', '212110' }; rownames = states; prefix = 'T'; varnames = strcat({prefix}, states); selected = cell(35, 35); SelectedTable = mat2dataset(selected, 'VarNames', varnames, 'ObsNames', rownames);
By using the above code, I got a 35X35 dataset. I want to apply transition rules on the dataset I got. I want the MATLAB program to automatically check for the states, which state verifying which rule? On the basis of which, MATLAB should automatically allocate values to this dataset.
Suppose states are represented as [i,j,k,l,m,n]. According to the rule,
  • for i>0
if {i,j,k,l,m,n}=={i+1, j, k, l, m ,n)
then, it should display " blue"
else if
for j=0,1 && i=1
{i,j,k,lm,n}=={i, j+1, k, l, m, n}
then it should display "green"***
The MATLAB program must automatically check the states and according to rules, it must specify the message.
Is this automatic checking possible?
Please help
Regards
Surabhi

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!