Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need asap MATLAB CODE Matlab Functions you may use Clear all, clc, rand, size, length zeros, ones. [] (empty array), sort, flip, rem mod Lab
need asap MATLAB CODE
Matlab Functions you may use Clear all, clc, rand, size, length zeros, ones. [] (empty array), sort, flip, rem mod Lab Exercise Write a simple script that will do the following tasks: Generate a matrix with random decimal numbers of values between 0 and 20. The size of the matrix should be defined as variables at the beginning of the script. Re-arrange the matrix elements such that the new matrix can produce staircase shape if plotted using bar3 command. The figures below show the original matrix plot and required output. 1 20 20 15 15 10 10 5 5 O 109105 23:09 12 Str 1072 Before After The below script lines can help you to rearrange the colormap to reflect the values of the matrix (the default map reflects the value of the y-axis) b = bar3 (A) : for k=1:length (b) zdata = b (b).Data; b(k). Data = zdata; b(k).FaceColor = 'interp'; end Matlab Functions you may use Clear all, clc, rand, size, length zeros, ones. [] (empty array), sort, flip, rem mod Lab Exercise Write a simple script that will do the following tasks: Generate a matrix with random decimal numbers of values between 0 and 20. The size of the matrix should be defined as variables at the beginning of the script. Re-arrange the matrix elements such that the new matrix can produce staircase shape if plotted using bar3 command. The figures below show the original matrix plot and required output. 1 20 20 15 15 10 10 5 5 O 109105 23:09 12 Str 1072 Before After The below script lines can help you to rearrange the colormap to reflect the values of the matrix (the default map reflects the value of the y-axis) b = bar3 (A) : for k=1:length (b) zdata = b (b).Data; b(k). Data = zdata; b(k).FaceColor = 'interp'; endStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started