Question: Using MATLAB i need this line of code to be fixed here a example of what i want Do a written correction entire code isnt

Using MATLAB i need this line of code to be fixed here a example of what i want
Do a written correction entire code isnt needed just need a correct statement to do as follows below
First it is rolling random numbers and saving them into a array
What needs to be fixed: below
Then Im using a if statement I want the If statement to search through the array to see if that random number has been rolled before and if it has to diplay what the number was that was rolled once before
 Using MATLAB i need this line of code to be fixed

PUBUSH LE VERS ONS VIEW Go lo - Run Section lew Save Find Files Q Find Breakpoints Run and Run Advance Advance FILE NAVIGATE PREAKPOINTS EDIT RUN OI MATLAB Drive > Untited m x roll- 230; 8. arrayrand-[]; 10 arrayrandnot-[): trainingdata-[): starttrainingdata-[]: k-e; 12 13 24 15 6-D for k-1:roll .7. numbroll - ceil(318*rand); Xdisp(numbroll); X put a random number to generate 260 training data arrayrand (k)-numbroll;% adds the rows in which the dice selected Xchecks to see if the number in contain in arrayrand and if it is displays the matched number. if contains(arrayrand,numbroll) disp("matches"+numbroll) else starttrainingdata T(numbroll,1:7); Tnew-[T;starttrainingdata):Xsaves the selected rows from T to make the training data Xdisp(k); k-k+1; end tatnainieod Xdisp(starttrainingdata) Xtrainingdata(i)-starttrainingdata; % need to make it so that them rows from T is saved into a * seperatetable IMAND WINDOW or using contains t argument must be a string array, character vector, or cell array of character vectors. r in Untitled (line 21) if contains (arrayrand, numbroll) D Type here to search

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 Databases Questions!