Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions