f=[a=2,k−=−4,k+=7,t=5] he largest positive element (m∞ ) is in matlab

You can use the max function to find the largest element of the array. In this case, f is not a valid array in MATLAB syntax. You can define f as follows:

main.m
f = [2, -4, 7, 5];
19 chars
2 lines

Then, you can find the largest positive element as follows:

main.m
m_inf = max(f(f>0))
20 chars
2 lines

This code will output the largest positive element in f. If f does not contain any positive elements, m_inf will be an empty array ([]).

related categories

gistlibby LogSnag