【问题标题】:Indeterminate number of arguments c# [duplicate]不确定数量的参数c#[重复]
【发布时间】:2017-11-24 13:45:07
【问题描述】:

我正在尝试在这里传递可变数量的参数。

Codification codebook = new codification(data,"Attr1","Attr2",..."AttrnumOfAttrColumns,"Result")

还有这里:

int[][] inputs = symbols.ToJagged<int>("Attr1","Arrt2",..."AttrnumOfAttrColumns);

我试图用一个不正确的 for 循环来做到这一点。有没有办法做到这一点?

Codification codebook = new Codification(data, for (int i = 0; i < numOfAttrColumns; i++) {return "Attr"+Convert.ToString(i) }, "Result");

【问题讨论】:

  • 编码码本 = 新编码(data,new string[] {"Attr1","Attr2",..."AttrnumOfAttrColumns,"Result"});
  • 我不认为这是重复的。 OP 的第三个代码块是他们试图寻求帮助的部分,当然这有点令人困惑。
  • OP 我想你所追求的是here

标签: c#


【解决方案1】:

根据Accord.net manual

你可以放

Codification codebook = new codification(data, new string[] {
  "Attr1", "Attr2", ..., "AttrnumOfAttrColumns", "Result"});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-24
    相关资源
    最近更新 更多