MATLAB: Custom function,how to make custom function or graph in matlab

customdigital image processingdigital signal processinggraphimage processing

Hello Sir, I have read many solutions of yours,which you given,you are nodoubt helping people,i also have a problem,i want to make a custom function,i am attaching picture,please have a look and tell me if i have x(i,j) values 0 to 10 and these values are on x-axis so how i can find values by puting this formula Xmd(x(i,j)). on x-axis L=11,so values on x-axis are o to 10 and on y axis values are from 0 to 1. thanks

Best Answer

  • So just make a function
    function signal = MakeSignal(a, b, L, yHeightAtB, numElements)
    x = linspace(0, L-1, numElements);
    y = ones(1, numElements); % Initialize
    slope2 = .....
    segment2 = x >= a & x <= b;
    y(segment2) = equation of that line.....
    segment3 = x >= b;
    y(segment3) = equation of that line.....
    That's a good start - go ahead and finish it.