From: - on
this question sounsds trivial, but as mtlabe is strange it is not trivlial.

i just want to ad a newline character at the end of something, but JUST a newline. witch seems impossible in matlab.
my program is something like:

while
if
fprintf bla
end
if
fprintf anotherbla
end
if
fprinft thethirdbla
end
frprintf newline
end

but fprintf(1,'/n') does not escape /n


And i am still wondering why someone created a sometimes escaping and sometiemes not escaping escpase sequentce.

is there a way to force the escape?
From: Paul on
"- " <nomail(a)doesnotexi.st> wrote in message <i1evuh$t90$1(a)fred.mathworks.com>...
> this question sounsds trivial, but as mtlabe is strange it is not trivlial.
>
> i just want to ad a newline character at the end of something, but JUST a newline. witch seems impossible in matlab.
> my program is something like:
>
> while
> if
> fprintf bla
> end
> if
> fprintf anotherbla
> end
> if
> fprinft thethirdbla
> end
> frprintf newline
> end
>
> but fprintf(1,'/n') does not escape /n
>
>
> And i am still wondering why someone created a sometimes escaping and sometiemes not escaping escpase sequentce.
>
> is there a way to force the escape?

You have \n is new line. You have to use also \r (carriage return)

try this way:
fprintf(fid,'\r\n');
From: Ashish Uthama on
On Mon, 12 Jul 2010 07:57:05 -0400, - <nomail(a)doesnotexi.st> wrote:

> but fprintf(1,'/n') does not escape /n

did you mean to try using fprintf(1,'\n') ?
From: - on
"Ashish Uthama" <first.last(a)mathworks.com> wrote in message <op.vfqcdtvja5ziv5(a)uthamaa.dhcp.mathworks.com>...
> On Mon, 12 Jul 2010 07:57:05 -0400, - <nomail(a)doesnotexi.st> wrote:
>
> > but fprintf(1,'/n') does not escape /n
>
> did you mean to try using fprintf(1,'\n') ?
fprinft(1,FORMAT) prints into the comand window.
From: Ashish Uthama on
On Mon, 12 Jul 2010 08:24:05 -0400, - <nomail(a)doesnotexi.st> wrote:

> "Ashish Uthama" <first.last(a)mathworks.com> wrote in message
> <op.vfqcdtvja5ziv5(a)uthamaa.dhcp.mathworks.com>...
>> On Mon, 12 Jul 2010 07:57:05 -0400, - <nomail(a)doesnotexi.st> wrote:
>> > but fprintf(1,'/n') does not escape /n
>> did you mean to try using fprintf(1,'\n') ?
> fprinft(1,FORMAT) prints into the comand window.


I was pointing out that you need to use the backslash ('\') to escape n to
create a newline.
The code you post uses the forward slash ('/').