如何解决在 Octave 中解析错误子类和类定义
上次我问 here 如何在另一个函数中调用参数。
那时,多亏了有用的建议,我注意到我在类定义中犯了错误。所以我想将 classdef
放入我的代码中。但它总是发生语法错误。所以,我的代码是这样的。
classdef dataimport %%superclass
methods
function pushbutton_Callback = dataimport(hObject,eventdata,handles)
fileName = uigetfile('*.xlsx')%%excel data import
handles.fileName = fileName;
eval('fileName')
guidata(hObject,handles)
endfunction
endmethods
endclassdef
classdef axisXimport < dataimport %%subclass
methods
function popupmenuX_Callback = axisXimport(hObject,handles)
fileName = pushbutton_Callback@dataimport(hObject,handles) %%methodname@parentclassname(args)
handles.fileName = fileName;
[numbers,colNames] = xlsread(fileName);
set(hObject,'string',colNames);
endfunction
endmethods
endclassdef
错误从第一行弹出,这里(classdef dataimport
)
>> versuch2
error: parse error near line 49 of file C:\Users\DEBIECHON\Desktop\Octave\versuch2.m
Syntax error
通过调用 Superclass 参数,我在 Octave 站点中看到了 this site 和 this。但我真的不明白为什么它会导致第一行出错。
非常感谢阅读我的问题并致以最诚挚的问候!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。