当前位置:编程学习 > Matlab >>

MATLAB m文件,代码,错误如下:求解啊

代码:function RandomPlot(n) if n<=1 n=2;end h_f=figure('NuberTitle','Off','Name','VC与MATLAB混合编程'); h_a=axes('parent',h_f); data=rand(1,n); plot(data,'parent',h_a); h_xlabel=get(h_a,'XLabel'); set(h_xlabel,'String','X轴'); h_ylabel=get(h_a,'YLabel'); set(h_ylabel,'String','Y轴'); h_title=get(h_a,'Title'); set(h_title,'String','随机数据曲线'); 错误: Error: File: RandomPlot.m Line: 3 Column: 59 The input character is not valid in MATLAB statements or expressions. >>
追问:
        	
				
谢谢了,但改过之后:又有错误
Input argument "n" is undefined.
Error in ==> RandomPlot at 2
if n<=1 n=2;end。
这个怎么改啊
你得输入n的
在command window 里 输RandomPlot(3)这样 不过还是有错误 自己看着改吧
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,