主要内容

本页采用了机器翻译。点击此处可查看英文原文。

setFileLogDecimation

根据模块路径和输入降采样值,为 File Log 模块设置降采样值

自 R2022a 起

说明

setFileLogDecimation(app_object,block_path,decimationValue) 为指定的 File Log 模块设置降采样值。该函数用于修改应用程序对象中 File Log 模块的降采样值。随后加载的实时应用程序 MLDATX 文件在 Speedgoat® 目标计算机上运行,其中 File Log 模块的降采样值已进行修改。

示例

示例

全部折叠

使用 setFileLogDecimation 函数为通过实时应用程序对象的模块路径指定的 File Log 模块设置降采样参数。

  1. 获取实时应用程序中 File Log 模块的模块路径。

    myApp = slrealtime.Application('slrt_ex_osc');
    myFileLogBlocks = getAllFileLogBlocks(my_App)
    myFileLogBlocks =
    
      2×1 cell array
    
        {["slrt_ex_osc/File Log"]}
        {["slrt_ex_osc/File Log"]}
  2. 获取所选 File Log 模块的消减值。

    myDecimation = getFileLogDecimation(myApp,"slrt_ex_osc/File Log")
    myDecimation =
    
      int32
    
       1
  3. 为选定的 File Log 模块设置更新后的降采样值。

    setFileLogDecimation(myApp,"slrt_ex_osc/File Log",2)

输入参数

全部折叠

提供访问方法以操作实时应用程序文件。

block_path 的取值可以是:

  • 空字符向量 ('') 或空字符串标量 ("") 用于基准或模型工作区变量

  • 字符向量或字符串标量,用于表示顶层模型中参数的块路径

  • 用于模型块参数和模型实例参数的字符向量或字符串标量元胞数组

示例: '', 'Gain1', {'top/model','sub/model'}

decimationValue 为 File Log 模块提供更新后的降采样值。

示例: 2

数据类型: int32

版本历史记录

在 R2022a 中推出