[問題]請問各位高手.程式碼有錯!

看板MATLAB作者 (秘密客)時間13年前 (2012/09/11 05:53), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
輸入程式碼: % 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
文章代碼(AID): #1GJc5mg6 (MATLAB)