مساعدة في كنابة كود

السلام عليكم ورحمة الله وبركاته

أنا جديد في برنامج الماتلاب
فياريت أجد أحد يساعدني في كتابة هذا الكود مشكورين مقدماُ

  1. Write code to do the following:
    a. Generate a random sized array of random numbers using: x = 10rand(ceil(10rand)+2,1)
    b. Use “for” loop to add up all the values in the array and assign the result to the variable sumx.
    i. For example, if the array is x = [1 1 1 1 1 1 1 1 1 2], then the sum of all the elements would be sumx = 11.
    c. Check your answer using the built-in MATLAB sum( ) function by adding the following code snippet to the end of your script. if sumx == sum(x) disp(‘Congratulations!!, you did it right’) load handel;sound(y,Fs) else fprintf(‘Sorry, %.2f ~= %.2f. Please try again.
    ’,sumx,sum(x)) end
    d. Repeat but use a “while” loop this time.
  2. Use the MATLAB publish feature to publish your script to a Word file. No title page is required for this exercise.