📄 plotter.cs
字号:
/*
* MATLAB Compiler: 4.4 (R2006a)
* Date: Sat Mar 31 16:31:57 2007
* Arguments: "-B" "macro_default" "-M" "-silentsetup" "-S" "-v" "-B"
* "dotnet:SpectraDemoComp,Plotter,1.0,private" "-W"
* "dotnet:SpectraDemoComp,Plotter,1.0,private" "-T" "link:lib" "-d"
* "C:/work/SpectraExample/SpectraDemoComp/src"
* "C:/work/SpectraExample/SpectraDemoComp/plotfft.m"
* "class{SignalAnalyzer:C:/work/SpectraExample/SpectraDemoComp/computefft.m}"
*/
using System;
using System.Reflection;
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;
[assembly: System.Reflection.AssemblyVersion("1.0.*")]
#if SHARED
[assembly: System.Reflection.AssemblyKeyFile(@"")]
#endif
namespace SpectraDemoComp
{
/// <summary>
/// The Plotter class provides a CLS compliant interface to the M-functions contained
/// in the files:
/// <newpara></newpara>
/// C:/work/SpectraExample/SpectraDemoComp/plotfft.m
/// <newpara></newpara>
/// matlabrc.m
/// <newpara></newpara>
/// dirname.m
/// <newpara></newpara>
/// deployprint.m
/// <newpara></newpara>
/// printdlg.m
/// </summary>
/// <remarks>
/// @Version 1.0
/// </remarks>
public class Plotter : IDisposable
{
#region Constructors
/// <summary internal= "true">
/// The static constructor instantiates and initializes the MATLAB Common Runtime
/// instance.
/// </summary>
static Plotter()
{
Assembly assembly= Assembly.GetExecutingAssembly();
string ctfFilePath= assembly.Location;
int lastDelimeter= ctfFilePath.LastIndexOf(@"\");
ctfFilePath= ctfFilePath.Remove(lastDelimeter, (ctfFilePath.Length - lastDelimeter));
if (MWMCR.InitializeApplication(new string[]{}))
{
mcr= new MWMCR(MCRComponentState.MCC_SpectraDemoComp_name_data,
MCRComponentState.MCC_SpectraDemoComp_root_data,
MCRComponentState.MCC_SpectraDemoComp_public_data,
MCRComponentState.MCC_SpectraDemoComp_session_data,
MCRComponentState.MCC_SpectraDemoComp_matlabpath_data,
MCRComponentState.MCC_SpectraDemoComp_classpath_data,
MCRComponentState.MCC_SpectraDemoComp_libpath_data,
MCRComponentState.MCC_SpectraDemoComp_mcr_application_options,
MCRComponentState.MCC_SpectraDemoComp_mcr_runtime_options,
MCRComponentState.MCC_SpectraDemoComp_mcr_pref_dir,
MCRComponentState.MCC_SpectraDemoComp_set_warning_state,
ctfFilePath, true);
}
}
/// <summary>
/// Constructs a new instance of the Plotter class.
/// </summary>
public Plotter()
{
}
#endregion Constructors
#region Finalize
/// <summary internal= "true">
/// Class destructor called by the CLR garbage collector.
/// </summary>
~Plotter()
{
Dispose(false);
}
/// <summary>
/// Frees the native resources associated with this object
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary internal= "true">
/// Internal dispose function
/// </summary>
protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
disposed= true;
if (disposing)
{
// Free managed resources;
}
// Free native resources
}
}
#endregion Finalize
#region Methods
/// <summary>
/// Provides a void output, 0-input interface to the plotfft M-function.
/// </summary>
/// <remarks>
/// M-Documentation:
/// PLOTFFT Plots the FFT and power spectral density data
/// PLOTFFT(FFTDATA, FREQ, POWERSPECT)
/// Plots the FFT and power spectral density from the specified data.
/// This file is used as an example for the .NET Builder
/// Language product.
/// </remarks>
///
public void plotfft()
{
mcr.EvaluateFunction(0, "plotfft");
}
/// <summary>
/// Provides a void output, 1-input interface to the plotfft M-function.
/// </summary>
/// <remarks>
/// M-Documentation:
/// PLOTFFT Plots the FFT and power spectral density data
/// PLOTFFT(FFTDATA, FREQ, POWERSPECT)
/// Plots the FFT and power spectral density from the specified data.
/// This file is used as an example for the .NET Builder
/// Language product.
/// </remarks>
/// <param name="fftData">Input argument #1</param>
///
public void plotfft(MWArray fftData)
{
mcr.EvaluateFunction(0, "plotfft", fftData);
}
/// <summary>
/// Provides a void output, 2-input interface to the plotfft M-function.
/// </summary>
/// <remarks>
/// M-Documentation:
/// PLOTFFT Plots the FFT and power spectral density data
/// PLOTFFT(FFTDATA, FREQ, POWERSPECT)
/// Plots the FFT and power spectral density from the specified data.
/// This file is used as an example for the .NET Builder
/// Language product.
/// </remarks>
/// <param name="fftData">Input argument #1</param>
/// <param name="freq">Input argument #2</param>
///
public void plotfft(MWArray fftData, MWArray freq)
{
mcr.EvaluateFunction(0, "plotfft", fftData, freq);
}
/// <summary>
/// Provides a void output, 3-input interface to the plotfft M-function.
/// </summary>
/// <remarks>
/// M-Documentation:
/// PLOTFFT Plots the FFT and power spectral density data
/// PLOTFFT(FFTDATA, FREQ, POWERSPECT)
/// Plots the FFT and power spectral density from the specified data.
/// This file is used as an example for the .NET Builder
/// Language product.
/// </remarks>
/// <param name="fftData">Input argument #1</param>
/// <param name="freq">Input argument #2</param>
/// <param name="powerSpect">Input argument #3</param>
///
public void plotfft(MWArray fftData, MWArray freq, MWArray powerSpect)
{
mcr.EvaluateFunction(0, "plotfft", fftData, freq, powerSpect);
}
/// <summary>
/// Provides the standard 0-input interface to the plotfft M-function.
/// </summary>
/// <remarks>
/// M-Documentation:
/// PLOTFFT Plots the FFT and power spectral density data
/// PLOTFFT(FFTDATA, FREQ, POWERSPECT)
/// Plots the FFT and power spectral density from the specified data.
/// This file is used as an example for the .NET Builder
/// Language product.
/// </remarks>
/// <param name="numArgsOut">The number of output arguments to return.</param>
/// <returns>An Array of length "numArgsOut" containing the output
/// arguments.</returns>
///
public MWArray[] plotfft(int numArgsOut)
{
return mcr.EvaluateFunction(numArgsOut, "plotfft");
}
/// <summary>
/// Provides the standard 1-input interface to the plotfft M-function.
/// </summary>
/// <remarks>
/// M-Documentation:
/// PLOTFFT Plots the FFT and power spectral density data
/// PLOTFFT(FFTDATA, FREQ, POWERSPECT)
/// Plots the FFT and power spectral density from the specified data.
/// This file is used as an example for the .NET Builder
/// Language product.
/// </remarks>
/// <param name="numArgsOut">The number of output arguments to return.</param>
/// <param name="fftData">Input argument #1</param>
/// <returns>An Array of length "numArgsOut" containing the output
/// arguments.</returns>
///
public MWArray[] plotfft(int numArgsOut, MWArray fftData)
{
return mcr.EvaluateFunction(numArgsOut, "plotfft", fftData);
}
/// <summary>
/// Provides the standard 2-input interface to the plotfft M-function.
/// </summary>
/// <remarks>
/// M-Documentation:
/// PLOTFFT Plots the FFT and power spectral density data
/// PLOTFFT(FFTDATA, FREQ, POWERSPECT)
/// Plots the FFT and power spectral density from the specified data.
/// This file is used as an example for the .NET Builder
/// Language product.
/// </remarks>
/// <param name="numArgsOut">The number of output arguments to return.</param>
/// <param name="fftData">Input argument #1</param>
/// <param name="freq">Input argument #2</param>
/// <returns>An Array of length "numArgsOut" containing the output
/// arguments.</returns>
///
public MWArray[] plotfft(int numArgsOut, MWArray fftData, MWArray freq)
{
return mcr.EvaluateFunction(numArgsOut, "plotfft", fftData, freq);
}
/// <summary>
/// Provides the standard 3-input interface to the plotfft M-function.
/// </summary>
/// <remarks>
/// M-Documentation:
/// PLOTFFT Plots the FFT and power spectral density data
/// PLOTFFT(FFTDATA, FREQ, POWERSPECT)
/// Plots the FFT and power spectral density from the specified data.
/// This file is used as an example for the .NET Builder
/// Language product.
/// </remarks>
/// <param name="numArgsOut">The number of output arguments to return.</param>
/// <param name="fftData">Input argument #1</param>
/// <param name="freq">Input argument #2</param>
/// <param name="powerSpect">Input argument #3</param>
/// <returns>An Array of length "numArgsOut" containing the output
/// arguments.</returns>
///
public MWArray[] plotfft(int numArgsOut, MWArray fftData,
MWArray freq, MWArray powerSpect)
{
return mcr.EvaluateFunction(numArgsOut, "plotfft", fftData, freq, powerSpect);
}
#endregion Methods
#region Class Members
private static MWMCR mcr= null;
private bool disposed= false;
#endregion Class Members
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -