Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cs251_group32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SILU PANDA
cs251_group32
Commits
fdc600e6
Commit
fdc600e6
authored
Aug 24, 2016
by
SILU PANDA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
silu panda
parent
a92d558c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
lab01_final_state_3.m
lab01_final_state_3.m
+22
-0
No files found.
lab01_final_state_3.m
0 → 100644
View file @
fdc600e6
function[z]=final_state(x,y) %x is action matrix and y is the initial matrix
a=[1 1 0 1 0 0 0 0 0;1 1 1 0 1 0 0 0 0;0 1 1 0 0 1 0 0 0;1 0 0 1 1 0 1 0 0;0 1 0 1 1 1 0 1 0;0 0 1 0 1 1 0 0 1;0 0 0 1 0 0 1 1 0;0 0 0 0 1 0 1 1 1;0 0 0 0 0 1 0 1 1];
b=[x(1,1);x(1,2);x(1,3);x(2,1);x(2,2);x(2,3);x(3,1);x(3,2);x(3,3)];
c=[y(1,1);y(1,2);y(1,3);y(2,1);y(2,2);y(2,3);y(3,1);y(3,2);y(3,3)];
v=a*b;
h=v.+c;%element wise addition
p=mod(h,2);%remainder after dividing by 2
z=[p(1,1),p(2,1),p(3,1);p(4,1),p(5,1),p(6,1);p(7,1),p(8,1),p(9,1)];
return
endfunction;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment