如何在类变量中自动更改类?

我的问题的核心是我必须处理不同长度的数组,并决定使用类变量。但是,我无法自动化子类之间的更改(请参见代码:U1..U3)。 有办法吗?如果不是,是否还有另一种方法可以处理行数在列与列之间变化的2D矩阵?在Matlab的背景下,我也尝试了“ Application.Evaluate”,但没有成功。感谢您的帮助。

Option Base 1
Option Explicit

Public Type UnitT
U1() As Double
U2() As Double
U3() As Double
End Type
Dim Resu() As UnitT

Sub test()
Dim Nul() As Variant,ArrayIn() As Double,i As Integer

Nul = [{5,10,15}]



ReDim Resu(2,1)
For i = 1 To 2
    ReDim Resu(i,1).U1(Nul(i))
Next i

'that would be the idea or something similar
'ReDim Resu(2,1)
'For i = 1 To 2
'    For j = 1 To 3 ' Ubound(U1..U3)
'    ReDim Resu(i,1).U(j)(Nul(i))
'    Next j
'Next i
lqn1987521 回答:如何在类变量中自动更改类?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3097058.html

大家都在问