Hi,
I want to write 'x' and 'y' data side by side in each loop.
I sue below code
x=-5:1:5y=x.^2fid=fopen('test.txt','w')for i = 1:lenth(x) fprintf(fid,'%d\t\%d', (x(i) y(i))endfclose(fid)mat
but I am stillnot getting it.
desired outpit:
X -5 -4 -3 -2 -1 0 1 2 3 4 5Y 25 16 9 4 1 0 1 4 9 16 25
Best Answer