从另一个类获取属性(matlab)

时间:2015-06-10 16:34:37

标签: matlab

是否可以从MatLab中的另一个类获取属性?

我有两个课程:ProjectTableAllProjectTablesProjectTable我尝试了以下内容:

properties (GetAccess = ?AllProjectTables)

但它不起作用。

1 个答案:

答案 0 :(得分:0)

这是一个有效的例子:

  >> a=ProjectTable(45)

  a = 

    ProjectTable with no properties.

  >> a.Value
  You cannot get the 'Value' property of ProjectTable.

  >> b=AllProjectTables(a)

  b = 

    AllProjectTables with properties:

      Project_Table: [1x1 ProjectTable]

  >> b.test

  ans =

      45

  >> b.Project_Table.Value
  You cannot get the 'Value' property of ProjectTable.

  >>

并测试:

var test = from e in DB.UnAuthEvents
                       join a in DB.UnAuthExceptionLists
                       on e.EventID equals a.EventID
                       where e.EventID == 1
                       select new ExceptionDTO
                       {
                           ExceptionTypeID = e.EventID ,
                           unauthTest = DB.UnAuthExceptionLists.Select(b=>new ExceptionListDTO {KeyFromOther= b.KeyFromOther,EventID = b.EventID}).Where(i=>i.EventID==e.EventID).ToList()

                       };