Question
Note: I need matlab code and it must be on first entry, output what the question needs and i need it without any false in the matlab pls
program logic: • Find the index of minimum element with min() function. Make sure to take two outputs while using min(), the
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Matlab code

=====================================================================================

function x= findSum(v)

%index of minimum element is stored in minindex
%minimum value is stored in minvalue
[minvalue,minindex]=min(v);

%replace element at min index with mean of v
v(minindex)=mean(v);

%sum of v
x=sum(v);

end

=====================================================================================

Output

MATLAB R2018a Х HOME PLOTS APPS EDITOR PUBLISH VIEW ? Search Documentation Log In La Find Files Insert Efx til Comment % will

Add a comment
Know the answer?
Add Answer to:
Note: I need matlab code and it must be on first entry, output what the question...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Not enough input arguments error in R line 4 [minvalue , minindex ] = min(v) ;...

    Not enough input arguments error in R line 4 [minvalue , minindex ] = min(v) ; some of ur teams solve it before 20 hr i need a correct code matlab pls Edit the code to the correct code matlab program logic: • Find the index of minimum element with min() function. Make sure to take two outputs while using min(), the second output is the location of the minimum element. • replace the element at minimum index with mean(v)...

  • Need help with this MATLAB question 4.4 (25 points) Write and test the code for the...

    Need help with this MATLAB question 4.4 (25 points) Write and test the code for the function mysteryFunction that takes a vector, V, generate a new vector W, in which each element is the sum of the corresponding element in V and the previous element of V, and return two values (mysteryMean, mysteryStdev] of W. Consider the previous element of V(1) to be 0. For example, [mysteryMean, mysteryStdev] = mysteryFunction(1:8), W= [1 3 5 7 9 11 13 15] mysteryFunction...

  • i need this done in Matlab 8. Write a function which reverses a vector, i.e. if...

    i need this done in Matlab 8. Write a function which reverses a vector, i.e. if the input is (4, 2, 1,5,-3], the output would be [-3,5, 1, 2,4]. 9. Write a function which computes the sum of every second element in a vector.

  • I need this program in MATLAB with different or another code. INPUT: x = [0 1...

    I need this program in MATLAB with different or another code. INPUT: x = [0 1 8 12 27]; y = [1 2 3 4 5]; nx = length(x); ny = length(y); n = length(x); if nx ~= ny display('Error. La cantidad de datos en x no es igual que los datos en y') end Sx = sum(x); Sxx = sum(x.^2); Sy = sum(y); Sxy = sum(x.*y); a1 = (n*Sxy - Sx*Sy)/(n*Sxx-(Sx)^2); a0 = (Sxx*Sy - Sxy*Sx)/(n*Sxx - (Sx)^2); m...

  • Need help on this Matlab problem, I do not know how to do it Problem 2....

    Need help on this Matlab problem, I do not know how to do it Problem 2. (2D Sorting) The following table contains the scores for the 4 students A,B.C and D for four Homeworks HW1 50 20 85 65 HW2HW 45 80 30 95 HW4 75 35 15 80 Student A Student B Student C Student D 40 60 100 a) Create a matrix with the above data b) What is the minimum score of all four homework? (use the...

  • 22Hello, I am keep getting this warning on MATLAB; ''Assignment has more non-singleton rhs dimensions than...

    22Hello, I am keep getting this warning on MATLAB; ''Assignment has more non-singleton rhs dimensions than non-singleton subscripts'' what does it mean?? the matlab code is; %%Use the built-in min and max function to find minimum element of matrix A and maximum element of matrix B for each column fprintf('Matrix from minimum of A maximum of B: \n'); A = [22,0;12 -4]; B = [14,4;-3 9]; R(1,:) = max(B); R(2,:) = min(A); disp(R); can you help me?? thank you so...

  • MATLAB This is a copy and paste of what we need to do. Enter this in...

    MATLAB This is a copy and paste of what we need to do. Enter this in MATLAB. Please explain what you are doing and why. I don't just want the answer. I want to study this. This is a 100 class and the teacher teaches it as if we are 300 students.... please help me learn not just get the answer % q11_sol.m % % Quiz #11 solutions % February 11, 2020 % %% Part 1 % For the given...

  • C Programming write two functions, similar to what you see in the sample program. The first will ask the user to enter some information (I have included the type in parentheses) First Name (char[]) L...

    C Programming write two functions, similar to what you see in the sample program. The first will ask the user to enter some information (I have included the type in parentheses) First Name (char[]) Last Name (char[]) Age (int) Height in Inches (double) Weight in Pounds (double) You will use pass-by-reference to modify the values of the arguments passed in from the main(). Remember that arrays require no special notation, as they are passed by reference automatically, but the other...

  • using this array I need to create a user created function in Matlab that does the...

    using this array I need to create a user created function in Matlab that does the following I have this so far but I'm so lost could you please make this with comments on what the codes do Lure dueren suuj (COM 94 97 95 19 91 88 95 87 90 72 78 60 98 87 81 79 76 69 192 80 77 73 78 70 80 89 81 186 94 901 b. Find the lowest grade in Math subject...

  • Please I need help with MATLAB .. PLease help me . Thankyou Write Matlab code to...

    Please I need help with MATLAB .. PLease help me . Thankyou Write Matlab code to plot a 2D sinc function over a 2D cartesian grid where x ranges from 100 to 355 and y ranges from 0 to 255 and the sinc is centered at somewhere not midway in the grid. First plot the grid, and then plot the function on the grid (both as grayscale and as a surface plot). Comment the code well, generate the figures and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT