I want to enter this function into matlab, but I am in doubt what to do with the infinite spectrum

My try was this, but the graph looks very wrong

I want to enter this function into matlab, but I am in doubt what to do with the infinite spectrum

My try was this, but the graph looks very wrong

Copyright © 2021 JogjaFile Inc.
As described by @icurays you should use the correct function and range:
Furthermore you will probably want to get your plot in the right position, so not only plot the function values, but also give the x values as input to your plot function:
I do not have Matlab at hand, so there may be a typo somewhere, but it should work like this.