📄 formulastring.m
字号:
function s = formulastring(Signal)%FORMULASTRING Gets the formula string for the CSINE object.% s = FORMULASTRING(Signal) returns a formatted string which represents% the formula for the CSINE object Signal.%% See also CSINE% Jordan Rosenthal, 05-Nov-1999
% Rev., 26-Oct-2000 Revised commentsif Signal.Amplitude == 1 A = '';elseif Signal.Amplitude == -1 A = '-';else A = [num2str(Signal.Amplitude) ' '];endw0 = 2/Signal.Period;if w0 == 1 w0 = '\pi';elseif w0 == -1 w0 = '-\pi';else w0 = [num2str(w0) '\pi'];endt = '\itt\rm';if Signal.Delay > 0 t = [' ( ' t ' - ' num2str(Signal.Delay) ' )'];elseif Signal.Delay < 0 t = [' ( ' t ' + ' num2str(-Signal.Delay) ' )'];endPhase = Signal.Phase/pi;if Phase == 0 Phase = '';elseif Phase == 1 Phase = ' + \pi';elseif Phase == -1 Phase = ' - \pi';elseif Phase > 0 Phase = [' + ' num2str(Phase) '\pi'];else Phase = [' - ' num2str(-Phase) '\pi'];endw = cpulse('Width',Signal.Length,'Delay',Signal.Delay);s = {[A 'sin ( ' w0 t Phase ' ) \itw\rm(' t ')'] , ... ['\itw\rm(' t ') = ' formulastring(w)]};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -