bugGNU Octave - Bugs: bug #37168, Different results using feval with...

 
 

bug #37168: Different results using feval with the same function with and without linspace

Submitted by:  None
Submitted on:  Wed 22 Aug 2012 04:10:39 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: EDMOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.2
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 22 Aug 2012 04:30:41 PM UTC, comment #2:

I don't think the formula you wrote is doing what you think it is.

You either need some additional parentheses to override default precedence rules, or you need to use .* and ./. I'm not sure what you intend, so I don't know what is correct. But as it is, you are doing some matrix operations when you pass a vector in for X, not a series of scalar operations.

John W. Eaton <jwe>
Project Administrator
Wed 22 Aug 2012 04:29:51 PM UTC, comment #1:

"Is anything wrong with my code?"

Yes, your inline function is not correctly vectorized,
you should have written it as:

the function 'vectorize' may be of help in avoiding similar mistakes:

Please, in the future, use the help mailing list rather than this bug tracker if you have questions about using Octave.

c.

Carlo de Falco <cdf>
Project Member
Wed 22 Aug 2012 04:10:39 PM UTC, original submission:

Hi,
I was using octave in Arch Linux with this code:

The output of the first two feval is different from the output given from the last feval using linspace.

but

Is anything wrong with my code?

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by cdf (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 22 Aug 2012 04:30:41 PM UTCjweItem GroupNone=>Incorrect Result
    Wed 22 Aug 2012 04:29:51 PM UTCcdfItem GroupIncorrect Result=>None
      StatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1