0

我创建了一个简单的 LabView 程序,如下所示,它尝试将数组 [1,0,3] 展平,然后将其展平并打印出内容。

但是,我这样做并不成功。我究竟做错了什么?

在此处输入图像描述

4

2 回答 2

3

What am I doing wrong?

You're not going through tutorials or you're not reading the context help for the unflatten function (Ctrl+H) or you're not reading the full help for the function (right click>>Help) or you're not looking at the examples (from the help or Help>>Find Examples). Take your pick (preferably all four).

If you want an actual answer it is that LV is strictly typed, and therefore you need to tell the unflatten function which data type you want it to output (1D DBL array) and you're not doing that, but the real answer is what's in the previous paragraph - you should use those tools to learn how to find such an answer yourself.

于 2013-06-11T06:06:05.023 回答
1

Flatten 到 String 返回的字符串只包含数据,而不是传入的数据类型的描述,所以为了再次 unflatten 它需要从 String 告诉 Unflatten 它是什么类型。您可以通过将一些适当类型的数据(任何数据 - 如果它是一个数组,它可以是一个空的)连接到 Type 终端来做到这一点。

我不认为这从 LabVIEW 2012 帮助中可以立即看出,但我认为如果您从 Unflatten from String 帮助页面链接到其中一个示例,则相当清楚。Read Flattened Data.vi 示例有一个连接到 Type 输入的数组。

于 2013-06-12T08:20:21.910 回答