bugGNU Octave - Bugs: bug #46718, Unable to create classes

 
 

bug #46718: Unable to create classes

Submitted by:  None
Submitted on:  Sat 19 Dec 2015 02:04:31 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: Works For MeAssigned to: None
Originator Name: Gadi LahavOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.0.0
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.

 

(Jump to the original submission Jump to the original submission)

Mon 07 Nov 2016 06:04:39 PM UTC, comment #7:

This is a working example for the polynomial class. There is nothing wrong with, you just must to use it correctly.

https://savannah.gnu.org/support/download.php?file_id=38899

addons_zz <addons_zz>
Mon 07 Nov 2016 06:03:14 PM UTC, comment #6:

(file #38899)

addons_zz <addons_zz>
Mon 07 Nov 2016 05:22:35 PM UTC, comment #5:

Creating classes

To create a class you need to make a folder prefixed with the symbol @. Inside the folder you need to create the constructor which is a function with the same name as the folder. For example, a class called dummy will be created in the folder @dummy and inside we should find a function (a method) dummy.m. The minimal content of this method is.

http://wiki.octave.org/Object_oriented_programming

addons_zz <addons_zz>
Mon 28 Dec 2015 05:06:32 PM UTC, comment #4:

Are you getting this problem when the polynomial.m file is correctly put in a @polynomial directory which is a subdirectory of the current directory?

Mike Miller <mtmiller>
Project Administrator
Sun 27 Dec 2015 01:10:20 AM UTC, comment #3:

I'm also getting the same problem while trying to run the polynomial example. I recently removed my octave and replaced it with a new copy of Octave-4.0_0. I'm running it on a Windows 10 machine.

As a test of creating a used a class out of the control package and got the following correct response:

>> pkg load control
>> h = filt([0,3],[1,4,2])


Transfer function 'h' from input 'u1' to output ...

3 z^-1
y1: -------------------
1 + 4 z^-1 + 2 z^-2

Sampling time: unspecified
Discrete-time model.

Delbert Johnson <del_johnson>
Mon 21 Dec 2015 01:54:14 PM UTC, comment #2:

I get the same error message as the OP if I create polynomial.m as a function file on the path, rather than in a @polynomial subdirectory of the path.

The error message could perhaps say something a little more helpful to the user.

Mike Miller <mtmiller>
Project Administrator
Sat 19 Dec 2015 04:11:27 PM UTC, comment #1:

Your polynomial code below is the same as examples/code/@polynomial/polynomial.m from the source tree which works fine for me.

Have you called your file polynomial.m and is it located in a @polynomial/ directory?

Try to change your current path (you can show it with pwd) wit cd so you see the @polynomial directory.

Andreas Weber <andy1978>
Project Member
Sat 19 Dec 2015 02:04:31 PM UTC, original submission:

Originally, I started out building a class for my own purposes, but I kept getting the following error:

So I went on and tried the tutorial on the web\documentation:

Invoked it by simply writing

Got the same error:

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #38899:  polynomial.zip added by addons_zz (720B - application/octet-stream - This is a working example for the polynomial class. There is nothing wrong with, you just must to use it correctly.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by addons_zz (Posted a comment)
  • -unavailable- added by del_johnson (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by andy1978 (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 07 Nov 2016 06:03:14 PM UTCaddons_zzAttached File-=>Added polynomial.zip, #38899
    Mon 22 Feb 2016 01:16:09 AM UTCmtmillerOpen/ClosedOpen=>Closed
    Sat 19 Dec 2015 04:11:27 PM UTCandy1978StatusNone=>Works For Me

    Back to the top


    Powered by Savane 3.1-cleanup1