WICHTIG: Der Betrieb von goMatlab.de wird privat finanziert fortgesetzt. - Mehr Infos...

Mein MATLAB Forum - goMatlab.de

Mein MATLAB Forum

 
Gast > Registrieren       Autologin?   

Partner:




Forum
      Option
[Erweitert]
  • Diese Seite per Mail weiterempfehlen
     


Gehe zu:  
Neues Thema eröffnen Neue Antwort erstellen

Flip charakter Array 3x3 to a whole line

 

Obama

Gast


Beiträge: ---
Anmeldedatum: ---
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 22.05.2009, 13:51     Titel: Flip charakter Array 3x3 to a whole line
  Antworten mit Zitat      
Hello People,

maybee you can help me:

I want to flip charackter arrays 3x3 for a example

'test1'
'test2'
'test3'

to a whole Line of text like: str = ' test1 test2 test3'

thanks all

Obama


LittleX
Forum-Guru

Forum-Guru


Beiträge: 494
Anmeldedatum: 14.05.09
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 22.05.2009, 14:54     Titel:
  Antworten mit Zitat      
Hi,

you could use the reshape command.
Code:

str = ['test1';'test2';'test3'];
strt = [str';'   ']; % transpose original array because reshape rearranges the elements column wise; add a "whitespace" line so that result looks nicer
r = reshape(strt,1,18) % rearrange so that all elements are in one row
 


or you could use concatenate
Code:
r = [str(1,:),' ',str(2,:),' ',str(3,:)];
Private Nachricht senden Benutzer-Profile anzeigen
 
Neues Thema eröffnen Neue Antwort erstellen



Einstellungen und Berechtigungen
Beiträge der letzten Zeit anzeigen:

Du kannst Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.
Du kannst Dateien in diesem Forum posten
Du kannst Dateien in diesem Forum herunterladen
.





 Impressum  | Nutzungsbedingungen  | Datenschutz | FAQ | goMatlab RSS Button RSS

Hosted by:


Copyright © 2007 - 2024 goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks

MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.