how can i make a function that accepts as input a vector of integers, which will return the largest and the second largest component of the vector for the first i think that is max1=max(max(C)) any idea for max2?
Sorry, felix, that I've solved your homework. Now it gets hard to submit it without cheating. Remember, that your teacher/assistent knwos this forum also, so it is strongly recommended to mention all sources.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.