×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Inequation in Matlab

Inequation in Matlab

Inequation in Matlab

(OP)
Is it possible to solve inequation in Matlab? I mean, like this:

x + 3 < 2


Is this possible and if it is, how to do it?

RE: Inequation in Matlab

HAve you bothered looking at the help files?

TTFN



RE: Inequation in Matlab

(OP)
Of course, I've tried help first with the word "inequation" - nothing found.

If you know how to find the answer from help, please tell me. Because English is not my first language and finding appropriate phrases can be sometimes difficult.

RE: Inequation in Matlab

inequation is not a word.  Perhaps you meant inequality.  Or you  could search on the symbols i.e. ">".  The Maple symbolic toolbox will help for an actual solution.  I MATLAB you can iterate on your own to find solutions or use the fmin and simular search functions.  They are are documented and have examples right in the help files.

jsolar

RE: Inequation in Matlab

(OP)
I've tried both: wiht "inequality" and with sign ">" and other signs for inequlity. Nothing came out. Any more ideas?

RE: Inequation in Matlab

You should get something like what is below.  Maybe your installation is bad.  Conatact the mathworks and give them your licence codes and the response from typing "ver" at the command prompt.  THe Mathworks also supplies their help on line.  If you are using the student version your results might be different.

>> help >
  Operators and special characters.
 
  Arithmetic operators.
    plus       - Plus                               +    
    uplus      - Unary plus                         +    
    minus      - Minus                              -    
    uminus     - Unary minus                        -    
    mtimes     - Matrix multiply                    *    
    times      - Array multiply                    .*    
    mpower     - Matrix power                       ^    
    power      - Array power                       .^    
    mldivide   - Backslash or left matrix divide    \    
    mrdivide   - Slash or right matrix divide       /    
    ldivide    - Left array divide                 .\    
    rdivide    - Right array divide                ./    
    kron       - Kronecker tensor product         kron   
 
  Relational operators.
    eq         - Equal                             ==     
    ne         - Not equal                         ~=     
    lt         - Less than                          <      
    gt         - Greater than                       >      
    le         - Less than or equal                <=     
    ge         - Greater than or equal             >=     
 
  Logical operators.
                 Short-circuit logical AND         &&     
                 Short-circuit logical OR          ||     
    and        - Element-wise logical AND           &      
    or         - Element-wise logical OR            |      
    not        - Logical NOT                        ~      
    xor        - Logical EXCLUSIVE OR
    any        - True if any element of vector is nonzero
    all        - True if all elements of vector are nonzero
 
  Special characters.
    colon      - Colon                              :
    paren      - Parentheses and subscripting      ( )              
    paren      - Brackets                          [ ]     
    paren      - Braces and subscripting           { }          
    punct      - Function handle creation           @
    punct      - Decimal point                      .      
    punct      - Structure field access             .      
    punct      - Parent directory                   ..     
    punct      - Continuation                       ...    
    punct      - Separator                          ,      
    punct      - Semicolon                          ;      
    punct      - Comment                            %      
    punct      - Invoke operating system command    !            
    punct      - Assignment                         =
    punct      - Quote                              '      
    transpose  - Transpose                         .'
    ctranspose - Complex conjugate transpose        '
    horzcat    - Horizontal concatenation          [,]     
    vertcat    - Vertical concatenation            [;]     
    subsasgn   - Subscripted assignment          ( ),{ },.   
    subsref    - Subscripted reference           ( ),{ },.   
    subsindex  - Subscript index                               
 
  Bitwise operators.
    bitand     - Bit-wise AND.
    bitcmp     - Complement bits.
    bitor      - Bit-wise OR.
    bitmax     - Maximum floating point integer.
    bitxor     - Bit-wise XOR.
    bitset     - Set bit.
    bitget     - Get bit.
    bitshift   - Bit-wise shift.
 
  Set operators.
    union      - Set union.
    unique     - Set unique.
    intersect  - Set intersection.
    setdiff    - Set difference.
    setxor     - Set exclusive-or.
    ismember   - True for set member.
 
  See also arith, relop, slash, function_handle.

jsolar

RE: Inequation in Matlab

(OP)
My friend I've tried everything you said to me. It is not a problem comparing two matrices - but how to compre two functions? Like this:

y = x + 1
y1 = x + 3

y < y1


Can Matlab find solutions here? This is my problem. And I've got the error that "it is not working with syms variables"

RE: Inequation in Matlab

The answer to what you have written is Boolean 1. You really are going to have to explain what you want in far more detail if you want a helpful answer.

Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: Inequation in Matlab

What exactly are you trying to accomplish?  Are you looking for that actual algebraic solution, in which case you are are SOL without the Symbolic Toolbox.  Or are you simply looking for the boolean answer to y < y1, in which case you should be using an if statement.

Is this for a class?  I'm finding it hard to believe that at computer professional can't answer this question.

TTFN



RE: Inequation in Matlab

Are you looking for the range of z for which the inequality is valid?  If so the following Maple in MATLAB should help.  If you waqnt to know the boolean as GregLocock said you can use the results for x and make a judgement.

The first statement says that the inequality holds for all values of x.  The second says for none.

maple( 'y1:=x+1: y3:=x+3: solve(y1<y3,x)' )

ans =

x

>> maple( 'y1:=x+1: y3:=x+3: solve(y1>y3,x)' )

ans =

     ''

jsolar

RE: Inequation in Matlab

(OP)
VisiGoth thanks a lot. I thought for myself that people will never understand what I need and that this cannot be done with matlab.

God bless you and a warm greeting from Slovenia,

Frenky

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources