I am trying to make a file named text.txt and write numbers 1 to 5 in it, and then print them.
x = [1 2 3 4 5]a = fopen('test.txt','w');fprintf(a,'%f\n',x)fclose(a);
The output I'm getting is:
x = 1 2 3 4 5ans = 45
Why am I getting ans = 45 ? Neither have I used a variable named ans, nor defined any function in it.
Best Answer