Matlab Experts!!!!

enwar3

Golden Member
Jun 26, 2005
1,086
0
0
How do I remove the extra spaces in the output?

IE so instead of:

ans =

5.0000 1.0000 0.2000

I get:

ans =
5.0000 1.0000 0.2000

I can't find it in google, because stuff like "remove spaces" returns much more complicated stuff...
 

KillerCharlie

Diamond Member
Aug 21, 2005
3,691
68
91
Originally posted by: enwar3
How do I remove the extra spaces in the output?

IE so instead of:

ans =

5.0000 1.0000 0.2000

I get:

ans =
5.0000 1.0000 0.2000

I can't find it in google, because stuff like "remove spaces" returns much more complicated stuff...

uh.... it looks the same to me?

The answer to your question is probably sprintf or some similar command.
 

Saint Michael

Golden Member
Aug 4, 2007
1,877
1
0
Originally posted by: KillerCharlie
Originally posted by: enwar3
How do I remove the extra spaces in the output?

IE so instead of:

ans =

5.0000 1.0000 0.2000

I get:

ans =
5.0000 1.0000 0.2000

I can't find it in google, because stuff like "remove spaces" returns much more complicated stuff...

uh.... it looks the same to me?

He wants to remove the carriage return below "ans =".
 

ed21x

Diamond Member
Oct 12, 2001
5,411
8
81
you can store the answer within a variable or something like that, and then output it as you see fit.

x = ans

or at least you would do something similar in java/c++.
 

enwar3

Golden Member
Jun 26, 2005
1,086
0
0
I meant I want to get rid of the blank line between ans and the vector... it's a command like line small or something...?