View the step-by-step solution to:

# a) Write a MATLAB function which calculates the minimum positive value of the elements of avector, and call it minpos. If there are no positive...

a) Write a MATLAB function which calculates the minimum positive value of the elements of avector, and call it minpos. If there are no positive values, it should return the empty matrix.Hint (this part only): Think find or logical relations.

b) If the previous part did not work for matrices, modify it so it does. That is, min returns a rowvector of the minimum value in each column of a matrix, and so should minpos.Hint (this part only): max and min ignore NaNs.

Sign up to view the entire interaction

Here is the code with description... View the full answer

clc;
clear all;
A = [-23 100 -37; -15 -52 10]; % Random matrix or you can take matrix of your
choice
if find(A&gt;0)
[i,j]=find(A==min(A(A&gt;0)))
% here i defines the row no. and j defines the...

### Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

### -

Educational Resources
• ### -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents