For gain and phase margins to appear on a Bode diagram, they must exist in the first place. More specifically, if "G" is the "frd" object that contains the frequency response data, then the expression
[Gm, Pm, Wcg, Wcp] = margin(G)
must return finite values for "Gm" and "Pm".
In case "Gm" and "Pm" are infinite, then further investigation is needed. Moreover, because "G" contains frequency response data for a discrete-time system, then it is possible that the gain and phase margins exist outside the range that the "margin" function considers when computing the gain and phase margins.
That is, the margin function only considers the range "[0, pi / Ts]" rad/s for margin calculations, where "Ts" is the sampling period associated with the system "G". To check if the margins exist outside of this range, set "G"’s sampling period to 0 using the expression "G.Ts = 0" and then execute the expression
[Gm, Pm, Wcg, Wcp] = margin(G)
once again to see if the gain and phase margins are now finite.
After executing the expression "G.Ts = 0", if the gain and phase margins turn out to be finite, then executing the "bodeplot" function should now show the Bode diagram with the gain and phase margins marked, as desired.