gloryzhu 发表于 2007-4-19 10:52

求助:一个因程序中括号匹配而出现的问题

在调试如下程序时,提示错误:
??? Error: File: d:\MATLAB7\work\GUI\example_9_7.m Line: 10 Column: 21
Unbalanced or misused parentheses or brackets.
程序的错误行使用了红色标注。

请高手点拨一下,多谢·!!
code如下:
prompt={'name','function to call','number'}
defans={'Anonymous','disp','I love you!'}
fields={'name','func','num'}
info=inputdlg(prompt, 'give it to me',1,defans)
if isempty(info)==0    %see if user hit cancel
    info = cell2struct(info, fields)
    myname=info.name
    myfunc=info.func
    mynum=str2num(info.num)
mycall= )']
    eval(mycall)
    msgbox(,'cool!')
end

eight 发表于 2007-4-19 11:01

原帖由 gloryzhu 于 2007-4-19 10:52 发表
在调试如下程序时,提示错误:
??? Error: File: d:\MATLAB7\work\GUI\example_9_7.m Line: 10 Column: 21
Unbalanced or misused parentheses or brackets.
程序的错误行使用了红色标注。

请高手点拨一下 ...

请上传 myfunc.m 文件或者 myfunc 函数

另外,建议在语句后添加分号

gloryzhu 发表于 2007-4-19 11:08

回复 #2 eight 的帖子

自己摸索了十几分钟
把它解决了
原因是:标点符号过多, 导致了括号匹配发生了错位。
多谢eight关注!
页: [1]
查看完整版本: 求助:一个因程序中括号匹配而出现的问题