Rad Matlb question 5 Please solve following question with clear steps using MatL
ID: 3556653 • Letter: R
Question
Rad Matlb question 5
Please solve following question with clear steps using MatLab programming.
Please solve following question with clear steps using MatLab programming. Write an MatLab program to create a matrix A and an array X. where both A and X should have the same values as those in Question 1. Calculate solution Y = A*X. and then save Y as a text file. Using MatLab function rand(l,100) to generate a 100-elements array with integer numbers range from 0 to 100 . then cany out the following statistic analysis: Calculate average value, Calculate median value, Calculate standard deviation, Calculate and display histogram Generate 1000. 10000 and 100000-elements array with integer numbers range from 0 to 100. repeat the above statistic analysis, and discuss the results. Write a MatLab program to model the following game of rolling two Six-Sided dice, and estimate the probability that the player wins. A player rolls two dice. Each die has six faces. These faces contain 1. 2. 3. 4. 5 and 6 spots. After the dice have come to rest, the sum of the spots on the two upward faces is calculated. If the sum is 7 or 11 on the first throw, the player wins. If the sum is 2. 3. or 12 on the first throw, the player loses. If the sum is 4. 5. 6. 8. 9 or 10 on the first throw, the sum becomes the player's point. To win. you must continue rolling the dice until you make your point. However, the player loses by rolling a 7 before making the point.Explanation / Answer
A=[1 2 3;4 5 6;3 2 1]; % A is a 3*3 matrix
X=[3;4;5]; % X is a 3*1 matrix
C = A*X
fid = fopen('C:progdata.txt', 'w+'); % provide the location of the text file
%where u r goint to write in
%file
for i=1:size(C, 1)
fprintf(fid, '%f ', C(i,:));
fprintf(fid, ' ');
end
fclose(fid);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.