作者LSCAT (秘密客)
看板MATLAB
标题[问题]请问各位高手.程式码有错!
时间Tue Sep 11 05:53:47 2012
输入程式码:
% Problem 1a
a=-5; b=5;
n=4;
xin=linspace(a,b,n+1);
yin= 1./(1+xin.^2);
xout=linspace(a,b,100);
[yout, cof] = Interppoly(xin,yin,xout);
ytrue= 1./(1+xout.^2);
plot(xout,yout,xout,ytrue)
title('Problem 1a functions; n=4');
print -deps assign1-out1.eps
pause(5);
plot(xout,abs(ytrue-yout))
title('Problem 1a error; n=4');
print -deps assign1-out2.eps
结果出现以下错误:
Error using name (line 104)
Cannot create output file '.\assign1-out1.eps'
Error in print (line 206)
pj = name( pj );
想请问该如何解错?
然後关於diary的指令
例如打成:diary assign1-output
却出错...没法成功...
To do this, begin your Matlab session by typing diary filename where filename
is the name of the file in which you want to store the Matlab output. Now that
your diary file is open, enter the command format compact (so that when you print out your
diary file, it will not have unnecessary spaces) and then the comment line
% Math 573 Assignment #1 yourname here
因为本人还是初学者...而且diary设定方面
一直不成功= ="
可否请各位大指点一下~
感谢万分!^^
--
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 204.52.215.1