使用CSV或内联阵列传递数组值

发布于 2025-01-27 06:07:18 字数 644 浏览 3 评论 0原文

我有data变量,其中我从功能从其他函数中获取44个数组值..

我想手动将这些值传递到data varible 。

  double features[44];
  get_features(ecg_series,csv_data.at(0).size(),features);
  union Entry data[44];
    float result[4];
    char filename[100];
    char res[4]={'A','N','O','~'};
    int index;
  for(int i=0;i<44;i++)
  {
    data[i].missing=-1;
    data[i].fvalue=features[i];
      // printf("feature[%d]=%.8f\n",i,features[i]);
  }

这是我的代码。

我想

  1. 直接将数组值传递到数据变量。该数组中有44个双重值。
  2. 或从CSV或其他文件中读取以上44个值。

我该怎么做?

我不熟练C ++,因此无法理解如何做到这一点。

I have data variable in which I am getting 44 array values from features from other function..

I want to manually pass these values to data variable.

  double features[44];
  get_features(ecg_series,csv_data.at(0).size(),features);
  union Entry data[44];
    float result[4];
    char filename[100];
    char res[4]={'A','N','O','~'};
    int index;
  for(int i=0;i<44;i++)
  {
    data[i].missing=-1;
    data[i].fvalue=features[i];
      // printf("feature[%d]=%.8f\n",i,features[i]);
  }

This is my code.

I want to do

  1. Passing array value to data variable directly. This array has 44 double values in it.
  2. Or read above 44 values from csv or other file.

How can I do it?

I am not proficient with C++ so could not get understand about how to do this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文