MATLAB: How to code below mathematical formula

code generationmathematicsMATLAB

I want to implement a below mathematical function in MATLAB, can anyone help me out?
myop.png

Best Answer

The simple MATLAB solution:
>> x = 1:30;
>> t = 23; % threshold
>> MYOP = sum(x>=t)/numel(x)
MYOP =
0.26667
Related Question