Question: * * This is for Matlab * * . This is what I have so far, but changing the values using indexing isn't working so

**This is for Matlab**. This is what I have so far, but changing the values using indexing isn't working so I'm not sure what I'm doing wrong:
clear % clear previously defined variables from environment
clc % clear command window
%% BOARD DIAGRAMS
boardStart =[23465432
11111111
00000000
00000000
00000000
00000000
-1-1-1-1-1-1-1-1
-2-3-4-6-5-4-3-2]
page1= boardStart(2628)=[01]
page2= page1(3739)=[-10]
page3= page2(2837)=[01]
page4= page3(3740)=[-50]
page5= page4(2526)=[06]
page6= page5(2837)=[-50]
fullGame = cat(page1, page2, page3, page4, page5, page6);
These are the directions:
Imagine you observed a very short chess match between two players. Your script will diagram what the board looked like after each move and will analyze the amount of time each player took for each move.
Start the script with opening comments that briefly describe what the program does and give your name and the date. These comments should include the coding scheme that well use for pieces on the chessboard: white pawn =1, white rook =2, white knight =3, white bishop =4, white queen =5, white king =6, corresponding negative numbers for the black pieces (black pawn =1, black rook =2, etc.), and empty square =0.
After the opening comments, clear any previously defined variables from memory.
Also clear the command window.
Divide the remainder of the program into two major sections: BOARD DIAGRAMS and ANALYSIS. Each section should have a prominent heading. For example: %% BOARD DIAGRAMS
IN THE "BOARD DIAGRAMS" SECTION OF YOUR SCRIPT:
Using the coding scheme described in the opening comments, define boardStart as an 88 matrix representing a chessboard with the pieces in the standard starting positions. Put white on the top and black on the bottom.
Define fullGame as an 886 array in which page 1 shows the positions of the pieces after the first move, page 2 shows the positions of the pieces after the second move, and so on (the starting positions of the pieces, as shown by the boardStart matrix, won't be included in the array).
Don't hard-code all the values on each page from scratch! Each state of the board is identical to the previous state except for 2 values. So you can initialize each page as the previous board state and then just change 2 values using indexing.
* * This is for Matlab * * . This is what I have

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!