User Tools

Site Tools


octave:octave

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
octave:octave [2008/08/06 15:54] devaoctave:octave [2008/08/06 16:09] deva
Line 7: Line 7:
 end; end;
 </code> </code>
 +
 ====strings==== ====strings====
 <code matlab> <code matlab>
-mystring = 'hello world'; +mystring = 'hello world'; % create string 
-sizeof(mystring)+sizeof(mystring) % get length of string 
 + 
 +mystrilyng2 = [ mystring, 'fisk']; % concatenate two strings 
 </code> </code>
 +sizeof on works in octave. in matlab the length of a string cannot be obtained!
  
 ====string array==== ====string array====
Line 25: Line 30:
 </code> </code>
 Note: Arrays are 1-based, not 0-based as they usually are in real programming languages. Note: Arrays are 1-based, not 0-based as they usually are in real programming languages.
 +Note: sizeof is an octave-only function. size can be used to get the array size in matlab.
  
 ====if then else==== ====if then else====
octave/octave.txt · Last modified: 2009/04/23 13:54 by deva