さて、私が直面している問題は非常に初歩的なものです。次のコードを記述して、行を10の部分に分割し、各部分の座標を見つけます。プログラムは正常に実行されますが、出力テキストファイルに正しい結果が表示されません。linspaceの結果をテキストファイルの列に出力したいだけです。ありがとう。
h=input('enter the size of the test box ');
theta=input('the angle');
xs=input('enter the x1 position of the slipplane');
ys=input('enter the y1 position of the slipplane');
r=h/sind(theta);
xe=(xs+(h/sind(theta)));
ye=(ys+(h/sind(theta)));
x1=xs+4;
y1=ys+4;
x10=xe-4;
y10=ye-4;
n=linspace(x1,x10,10)
m=linspace(y1,y10,10)
fid = fopen('result.txt', 'wt');
fprintf(fid,' %f\t %f\n',n,m);
fclose(fid);