How to include next line while showing the output?

Hello everyone..
I have to give my output as when the line ends, the cursor goes to the next line and shows the output in the next line so what code should i have to give?
Please help me

4 Comments

Please expand on the question. Perhaps you could give an example.
Hello...
suppose my input is an image file
INPUT- ABCDEFGH
IJKLMNOP
so my output should be the same i.e.
ABCDEFGH
IJKLMNOP
But it is coming as ABCDEFGHIJKMNOP
Now tell me what is the solution for this?
How are you reading the data? What command are you using to display it? What is class() of the variable you have the data stored in?
The data is reading by matching with the templates with the help of image segmentation.
i am using the textbox to display the data. so i want the output to be displayed as the input is, as descibed in the above example.
The class of variable is array.
Please give me some solution..

Sign in to comment.

Answers (2)

You can use the command input(''). When your matlab programm finish will ask you for the parameter to continue.
String
For multiple line editable text or static text controls, line breaks occur between each row of the string matrix, and each cell of a cell array of strings. Vertical slash ('|') characters and \n characters are not interpreted as line breaks, and instead show up in the text displayed in the uicontrol.

7 Comments

So what i have to do den?
please explain
How are you setting the String of the uicontrol textbox at present? The String parameter needs to be a cell array of strings, or a character array.
set(handles.pqr, 'String', ['ABCDEFGH'; 'IJKLMNOP'])
or
set(handles.pqr, 'String', {'ABCDEFGH', 'IJKLMNOP'})
|A| |B| |C| |D| |E| |F| |G| |H| |i| |J| |K| |L| |M| |N| |O| |P| |Q| |R| |S| |T| |U| |V| |w| |X| |Y| |Q| |w| |E| |R| |T| |Y| |K| |E| |Y| |B| |O| |A| |R| |D| |U| |S| |A| |N| |O| |M| |E| |N| |I| |2| |J|
This is the input.
i want the output(in a text box, also in a word document) to be in the same alignment as input.
but this is coming in a single line.
SO What should i do for this thing?
Also i can't set the string property of the text box because i have variable inputs.
Tell me something for this..
Thanks a lot!!
If that is your input, then you cannot have the output have the same alignment as the input, as your input has no position information remaining on it.
My input can be any image of letters or digits
e.g
ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
like this or anything with a string of letters, digits, special characters.
I am only concerned with the output as it should be in the same form as the input is..
For ur convenience i have uploaded a file in File Exchange which is input file.
the file name is double1.jpg.
I am not able to locate that file. The File Exchange people do not approve uploads which are solely images or data files -- only programs and models.
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers

Sign in to comment.

Asked:

on 3 May 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!