在julia中连接数组 [英] concatenate array in julia

查看:145
本文介绍了在julia中连接数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Julia中连接二维数组?

How can I concatenate two-dimensional arrays in Julia?

它们的类型为Array{UInt8, 2}.

我尝试了hvcat(),但收到错误消息

I have tried hvcat(), but I get the error message

LoadError: MethodError: no method matching hvcat(::Array{UInt8,2}, ::Array{UInt8,2})

任何帮助将不胜感激.

推荐答案

您到底想如何将它们串联起来?例如,以下两种方法均可工作:

How exactly do you want to concatenate them? The following, for example, both work:

A = rand(UInt8, 2,2)
B = rand(UInt8, 2,2)

C = [A B]
D = [A ; B]

这篇关于在julia中连接数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆