Question
matlab
r own code for the Matl.ab function min( ) that will have a vector or and will return the minimum and index matrix of the min
0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB:


clc;clear all;

A=[1 22 30 4 15;
11 12 10 8 35;
21 32 5 44 60;]

[M,N]=size(A);
for i = 1 :N   
AA = A(:,i)';
m = AA(1);
for i1 = 2:M
if m > AA(i1)
m = AA(i1);
end
minimum(i)=m;
index(i)=find(AA==m);
end
end
disp('Minimum values of each column of the matrix')
disp(minimum)

disp('index of the mMinimum values of each column of the matrix')
disp(index)

Command window:

A =

1 22 30 4 15
11 12 10 8 35
21 32 5 44 60

Minimum values of each column of the matrix
1 12 5 4 15
index of the mMinimum values of each column of the matrix
1 2 3 1 1
>>

Add a comment
Know the answer?
Add Answer to:
matlab r own code for the Matl.ab function min( ) that will have a vector or and will return the minimum and index matrix of the minimum for each column of matrix. This code must use a loop or nes...
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
  • matlab r own code for the Matl.ab function min( ) that will have a vector or...

    matlab r own code for the Matl.ab function min( ) that will have a vector or and will return the minimum and index matrix of the minimum for each column of matrix. This code must use a loop or nested loop. the vector or

  • *MATLAB CODE* 3)Write a function 'mydsort' that sorts a vector in descending order (using a loop,...

    *MATLAB CODE* 3)Write a function 'mydsort' that sorts a vector in descending order (using a loop, not the built-in sort function). 4)write a function that will receive a vector and will return two index vectors: one for ascending order and one for descending order. Check the function by writing a script that will call the function and then use the index vectors to print the original vector in ascending and descending order. **Please make sure they work. I have found...

  • Matlab Write a function called matrixsum that takes any matrix to calculate and return the sum...

    Matlab Write a function called matrixsum that takes any matrix to calculate and return the sum of all matrix elements (this function must not use any array operations. It must instead use a for-loop.)

  • Note: I need matlab code and it must be on first entry, output what the 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 second output is the location of the minimum element. • replace the element at minimum index with mean(v) • find sum(v) and assign it to output program: function x =...

  • For “Extract the column basis”, using the MATLAB functions rref and rank, make your own function...

    For “Extract the column basis”, using the MATLAB functions rref and rank, make your own function file to find pivot columns of A from the result of rref(A). Do NOT use the syntax [R pivotcols] = rref(A), use only rref(A). You may use the MATLAB commands min and find.please follow the instructions!! please help me , I have to submit in 2 hours

  • MATLAB - An example of code that uses a loop, then use a built-in function to...

    MATLAB - An example of code that uses a loop, then use a built-in function to vectorize the loop instead. Thank you!

  • Please the write code using Matlab 8. Write your own code to perform matrix multiplication. Recall...

    Please the write code using Matlab 8. Write your own code to perform matrix multiplication. Recall that to multiply two matrices, the inner dimensions must be Every element in the resulting C matrix is obtained by: Your code must be a function file and it must check to see if matrix multiplication can be performed on the provided matrices. Test your code with the following matrices: 4 4 2 9 -3 A2 17

  • what is a good matlab code to out put this matrix from question 1 to 3...

    what is a good matlab code to out put this matrix from question 1 to 3 HITA 1)-The general form cf the quadratic equation is a +bx+c 0 Wrte a MATLAB function named quadratic that finds the two roots of this equation and x when given the coeficients a, b and c 2)-Create a random matrix A in MATLAB with 6 rows and 3 oolumns using the rand) function 3)-Now modify quadratic by so that il can take each row...

  • 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)...

  • (MATLAB): Suppose that you are given a positive definite symmetric matrix A, a vector b, and...

    (MATLAB): Suppose that you are given a positive definite symmetric matrix A, a vector b, and a real number c. Write MATLAB code which finds the minimum of the function f() r A bc subject to the constraint rT =1 for some vector r and real number . Note: This is a Lagrange Multi pliers problem It turns out that the Lagrange multiplier algebra is simply matrix algebra, which you can easily do in MATLAB. It may be a In...

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