5.0

5.0 | 2 ratings Rate this file 22 downloads (last 30 days) File Size: 1.85 KB File ID: #24273

Wrap a long syms equations

by Mohannad Hakeem

 

27 May 2009 (Updated 28 May 2009)

Code covered by BSD License  

wraps a long syms equation so that it becomes more readable.

Download Now | Watch this File

File Information
Description

WRAP_string(string1) rewrites a long syms equation and wraps
it so that it becomes more readable. It automatically divides the expression into individual lines with three dots "..." at the end of each line. Moreover, it detects the existence of operators +,-,*,/ so that it doesn't cut a long name of a variable (such as Lamda_w).

Inputs:
string1: An expression written in syms
n_columns: users can change the maximum width of each line

Required Products Symbolic Math Toolbox
MATLAB release MATLAB 7.0.4 (R14SP2)
Zip File Content  
Other Files license.txt,
WRAP_string.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
27 May 2009 us

there should be a L1 line in the help section...
the help section is broken: add a % between the description and the example...
the n_columns variable should be an optional input making it more easy to change than having to edit the file...
the result should also be collected in an (optional) output argument...

us

04 Jun 2009 Mohannad Hakeem  
04 Jun 2009 Nassim Khaled

There should be something built-in/matlab to manipulate equations and text. Thanks

Please login to add a comment or rating.
Updates
28 May 2009

this file was updated so that it ends each line on a mathematical operator (+,-,*,/). in the previous edition, the code might end a line while cutting the name of a long variable (such as Lamda_w)

Tag Activity for this File
Tag Applied By Date/Time
syms Mohannad Hakeem 27 May 2009 10:56:11
wrap text Mohannad Hakeem 27 May 2009 10:56:11
line width Mohannad Hakeem 27 May 2009 10:56:11
text formatting Mohannad Hakeem 27 May 2009 10:56:11
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com