GUI Output

I have my gui which displays words selected from a group of words and phrases to form a sentence.However,when words are selected,they are stacked vertically instead of forming a sentence the normal way(words appearing from left to right).Any help will be appreciated.Thanks.

Respuestas (2)

Matt Fig
Matt Fig el 23 de Feb. de 2011

0 votos

What code are you using to display the sentence?
Matt Tearle
Matt Tearle el 23 de Feb. de 2011

0 votos

As Matt Fig says, it would help to know what you're doing to get a vertical stack. Are you using char of a cell array of strings, perhaps?
Anyway, as a general approach, if you have a cell array of strings, one word per cell, something like this should do the job:
words = {'the';'quick';'brown';'fox';'etc'}
s = sprintf('%s ',words{:});
set(uitextbox,'string',s)

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 23 de Feb. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by