MATLAB:基类的导入包 [英] MATLAB : import package for base class

查看:184
本文介绍了MATLAB:基类的导入包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基类A和一个派生类B,它们存储在以下文件夹结构中。

i have a base class A and a derived class B which are stored in the following folder structures.

+myPackage (package Path)
  @A    ( folder of class A )
    A.m ( filename of class )
  @B
    B.m

现在我想使用具有以下头部的B类

Now i want to use class B which has the following head

classdef B < A

遗憾的是,这不起作用,因为它们位于不同的文件夹中,我无法像这样导入:

unfortunately this does not work because they are in different folders and i cannot import like this:

import myPackage.*
classdef B < A

是否有可能在不丢失文件夹组织的情况下解决这个问题?

Is it possible to solve this without loosing the folder organisation?

推荐答案

我想如果你写了

classdef B < mypackage.A

它应该有效。

这篇关于MATLAB:基类的导入包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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