strcells functionality in Octave?

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

strcells functionality in Octave?

seektime
Hi All,

I stumbled upon a function "any2csv.m" on Matlab Central, which I found useful (by description). Tried it in Octave 3.6.1 but it threw an error. I didn't spend my time on it but found that it calls "strcells", a function that seems to ship with Matlab, but is not part of my Octave version. It basically turns fields of a struct into cells, and outputs a cell array.

Does anyone had ideas if Octave already has such functionality?

Thanks,
michael
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

bpabbott
Administrator
On Dec 8, 2012, at 7:24 AM, seektime wrote:

> Hi All,
>
> I stumbled upon a function "any2csv.m" on Matlab Central, which I found
> useful (by description). Tried it in Octave 3.6.1 but it threw an error. I
> didn't spend my time on it but found that it calls "strcells", a function
> that seems to ship with Matlab, but is not part of my Octave version. It
> basically turns fields of a struct into cells, and outputs a cell array.
>
> Does anyone had ideas if Octave already has such functionality?
>
> Thanks,
> michael

I don't think strcells() is a core Matlab function.  Can you find it in Matlab's docs?

If not, can you give us an example of how it is used so that we can help you find a replacment/equivalent?

Ben


_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Terry Duell
On Sat, 08 Dec 2012 09:58:29 +1100, Ben Abbott <[hidden email]> wrote:

> On Dec 8, 2012, at 7:24 AM, seektime wrote:
>
>> Hi All,
>>
>> I stumbled upon a function "any2csv.m" on Matlab Central, which I found
>> useful (by description). Tried it in Octave 3.6.1 but it threw an  
>> error. I
>> didn't spend my time on it but found that it calls "strcells", a  
>> function
>> that seems to ship with Matlab, but is not part of my Octave version. It
>> basically turns fields of a struct into cells, and outputs a cell array.
>>
>> Does anyone had ideas if Octave already has such functionality?
>>
>> Thanks,
>> michael
>
> I don't think strcells() is a core Matlab function.  Can you find it in  
> Matlab's docs?

 From quick look at the any2csv.m, str2cells() is a function that is  
included with the any2csv.m code


Cheers,
--
Regards,
Terry Duell
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Terry Duell
On Sat, 08 Dec 2012 10:23:55 +1100, Terry Duell <[hidden email]>  
wrote:


>
>  From quick look at the any2csv.m, str2cells() is a function that is  
> included with the any2csv.m code

I meant to say '...included within...' i.e. it's a subfunction.
Any2csv looks like really useful function.
I have contacted the author and asked if he can make the code available  
where there are no restrictions on its use.
I'll post when I know more.

Cheers,
--
Regards,
Terry Duell
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Jordi Gutiérrez Hermoso-2
In reply to this post by seektime
On 7 December 2012 17:24, seektime <[hidden email]> wrote:
> I stumbled upon a function "any2csv.m" on Matlab Central, which I found
> useful (by description). Tried it in Octave 3.6.1

As I mentioned elsewhere, you should know that you have violated
Matlab Central's terms of use and likely are, by their definition, a
"pirate":

    http://wiki.octave.org/FAQ#Why_can.27t_I_use_code_from_File_Exchange_in_Octave.3F_It.27s_released_under_a_BSD_license.21

If this code is useful for Octave use, it would be helpful to get the
original author to upload it elsewhere.

- Jordi G. H.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Juan Pablo Carbajal-2
On Sun, Dec 9, 2012 at 5:30 PM, Jordi Gutiérrez Hermoso
<[hidden email]> wrote:

> On 7 December 2012 17:24, seektime <[hidden email]> wrote:
>> I stumbled upon a function "any2csv.m" on Matlab Central, which I found
>> useful (by description). Tried it in Octave 3.6.1
>
> As I mentioned elsewhere, you should know that you have violated
> Matlab Central's terms of use and likely are, by their definition, a
> "pirate":
>
>     http://wiki.octave.org/FAQ#Why_can.27t_I_use_code_from_File_Exchange_in_Octave.3F_It.27s_released_under_a_BSD_license.21
>
> If this code is useful for Octave use, it would be helpful to get the
> original author to upload it elsewhere.
>
> - Jordi G. H.
> _______________________________________________
> Help-octave mailing list
> [hidden email]
> https://mailman.cae.wisc.edu/listinfo/help-octave

Please try to free the code!
Send a letter to the author asking they to free their code. Here are
some examples
http://wiki.octave.org/Asking_for_package_to_be_released_under_GPL:_examples

Fell free to remix and reuse, just make sure you use your name!
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Terry Duell
In reply to this post by Jordi Gutiérrez Hermoso-2
On Mon, 10 Dec 2012 03:30:29 +1100, Jordi Gutiérrez Hermoso  
<[hidden email]> wrote:

> On 7 December 2012 17:24, seektime <[hidden email]> wrote:
>> I stumbled upon a function "any2csv.m" on Matlab Central, which I found
>> useful (by description). Tried it in Octave 3.6.1
>
> As I mentioned elsewhere, you should know that you have violated
> Matlab Central's terms of use and likely are, by their definition, a
> "pirate":
>
>     http://wiki.octave.org/FAQ#Why_can.27t_I_use_code_from_File_Exchange_in_Octave.3F_It.27s_released_under_a_BSD_license.21
>
> If this code is useful for Octave use, it would be helpful to get the
> original author to upload it elsewhere.

The code is also available here...

<http://code.google.com/p/ewh-bp-project/source/browse/trunk/bp-matlab-interface/any2csv.m?spec=svn7f9c995eee3c172e8e9f2c19f0153ead1099fde9&r=7f9c995eee3c172e8e9f2c19f0153ead1099fde9>

Not sure if this satisfies the requirement.
No response thus far from the original author

Cheers,
--
Regards,
Terry Duell
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Juan Pablo Carbajal-2
On Mon, Dec 10, 2012 at 12:18 AM, Terry Duell <[hidden email]> wrote:

> On Mon, 10 Dec 2012 03:30:29 +1100, Jordi Gutiérrez Hermoso
> <[hidden email]> wrote:
>
>> On 7 December 2012 17:24, seektime <[hidden email]> wrote:
>>>
>>> I stumbled upon a function "any2csv.m" on Matlab Central, which I found
>>> useful (by description). Tried it in Octave 3.6.1
>>
>>
>> As I mentioned elsewhere, you should know that you have violated
>> Matlab Central's terms of use and likely are, by their definition, a
>> "pirate":
>>
>>
>> http://wiki.octave.org/FAQ#Why_can.27t_I_use_code_from_File_Exchange_in_Octave.3F_It.27s_released_under_a_BSD_license.21
>>
>> If this code is useful for Octave use, it would be helpful to get the
>> original author to upload it elsewhere.
>
>
> The code is also available here...
>
> <http://code.google.com/p/ewh-bp-project/source/browse/trunk/bp-matlab-interface/any2csv.m?spec=svn7f9c995eee3c172e8e9f2c19f0153ead1099fde9&r=7f9c995eee3c172e8e9f2c19f0153ead1099fde9>
>
> Not sure if this satisfies the requirement.
> No response thus far from the original author
>
> Cheers,
> --
> Regards,
> Terry Duell
>
> _______________________________________________
> Help-octave mailing list
> [hidden email]
> https://mailman.cae.wisc.edu/listinfo/help-octave

As far s I see that code is released under Modified BSD which is GPL
compatible and FSF kind of approves it
http://www.gnu.org/licenses/license-list.html#ModifiedBSD

I think we can grab that function, without troubles.

Jordi?
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

lukshuntim
In reply to this post by Juan Pablo Carbajal-2
On 12/10/2012 01:12 AM, Juan Pablo Carbajal wrote:

> On Sun, Dec 9, 2012 at 5:30 PM, Jordi Gutiérrez Hermoso
> <[hidden email]> wrote:
>> On 7 December 2012 17:24, seektime <[hidden email]> wrote:
>>> I stumbled upon a function "any2csv.m" on Matlab Central, which I found
>>> useful (by description). Tried it in Octave 3.6.1
>>
>> As I mentioned elsewhere, you should know that you have violated
>> Matlab Central's terms of use and likely are, by their definition, a
>> "pirate":
>>
>>     http://wiki.octave.org/FAQ#Why_can.27t_I_use_code_from_File_Exchange_in_Octave.3F_It.27s_released_under_a_BSD_license.21
>>
>> If this code is useful for Octave use, it would be helpful to get the
>> original author to upload it elsewhere.
>>
>> - Jordi G. H.
>> _______________________________________________
>> Help-octave mailing list
>> [hidden email]
>> https://mailman.cae.wisc.edu/listinfo/help-octave
>
> Please try to free the code!
> Send a letter to the author asking they to free their code. Here are
> some examples
> http://wiki.octave.org/Asking_for_package_to_be_released_under_GPL:_examples
>

Maybe it's useful to add a sentence or two to the FAQ mentioned by Jordi
pointing to this information. Something like this at the end?

"Some examples of letters/email to authors can be found in
http://wiki.octave.org/Asking_for_package_to_be_released_under_GPL:_examples.
Feel free to remix and reuse, just make sure you use your name!"

Regards,
ST
--

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Terry Duell
In reply to this post by Juan Pablo Carbajal-2
On Mon, 10 Dec 2012 16:44:52 +1100, Juan Pablo Carbajal  
<[hidden email]> wrote:

> On Mon, Dec 10, 2012 at 12:18 AM, Terry Duell <[hidden email]>  
> wrote:

[snip]

>> The code is also available here...
>>
>> <http://code.google.com/p/ewh-bp-project/source/browse/trunk/bp-matlab-interface/any2csv.m?spec=svn7f9c995eee3c172e8e9f2c19f0153ead1099fde9&r=7f9c995eee3c172e8e9f2c19f0153ead1099fde9>
>>
>> Not sure if this satisfies the requirement.
>> No response thus far from the original author

[snip]

> As far s I see that code is released under Modified BSD which is GPL
> compatible and FSF kind of approves it
> http://www.gnu.org/licenses/license-list.html#ModifiedBSD
>
> I think we can grab that function, without troubles.

I have been testing the any2csv.m from the google code site, and Octave  
3.6.3 doesn't like it.
There seems to be a number of problems, and I'm lacking knowledge in  
figuring out why.
I will plod on, but it would be good if others with more knowledge can  
have a look at it.

Cheers,
--
Regards,
Terry Duell
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

seektime
In reply to this post by lukshuntim
On Mon, 2012-12-10 at 22:15 +0800, [hidden email] wrote:

> On 12/10/2012 01:12 AM, Juan Pablo Carbajal wrote:
> > On Sun, Dec 9, 2012 at 5:30 PM, Jordi Gutiérrez Hermoso
> > <[hidden email]> wrote:
> >> On 7 December 2012 17:24, seektime <[hidden email]> wrote:
> >>> I stumbled upon a function "any2csv.m" on Matlab Central, which I found
> >>> useful (by description). Tried it in Octave 3.6.1
> >>
> >> As I mentioned elsewhere, you should know that you have violated
> >> Matlab Central's terms of use and likely are, by their definition, a
> >> "pirate":
> >>
> >>     http://wiki.octave.org/FAQ#Why_can.27t_I_use_code_from_File_Exchange_in_Octave.3F_It.27s_released_under_a_BSD_license.21
> >>
> >> If this code is useful for Octave use, it would be helpful to get the
> >> original author to upload it elsewhere.
> >>
> >> - Jordi G. H.
> >> _______________________________________________
> >> Help-octave mailing list
> >> [hidden email]
> >> https://mailman.cae.wisc.edu/listinfo/help-octave
> >
> > Please try to free the code!
> > Send a letter to the author asking they to free their code. Here are
> > some examples
> > http://wiki.octave.org/Asking_for_package_to_be_released_under_GPL:_examples
> >
>
> Maybe it's useful to add a sentence or two to the FAQ mentioned by Jordi
> pointing to this information. Something like this at the end?
>
> "Some examples of letters/email to authors can be found in
> http://wiki.octave.org/Asking_for_package_to_be_released_under_GPL:_examples.
> Feel free to remix and reuse, just make sure you use your name!"
>
> Regards,
> ST

FYI, I emailed the author of the file (who has posted a few more
beautiful m-files). Will keep you posted as to fresh developments...

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Terry Duell
On Tue, 11 Dec 2012 16:43:21 +1100, Michael Krause  
<[hidden email]> wrote:


>
> FYI, I emailed the author of the file (who has posted a few more
> beautiful m-files). Will keep you posted as to fresh developments...
>

Let's hope he doesn't get bombarded with too many requests :-)
I emailed him on the 8th (and posted to that effect), and I think there  
was another as well.
I think the copy of the code available on the google code site should  
allow use with octave. I am working on that assumption.


Cheers,
--
Regards,
Terry Duell
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Jordi Gutiérrez Hermoso-2
On 11 December 2012 01:04, Terry Duell <[hidden email]> wrote:
> I think the copy of the code available on the google code site should allow
> use with octave. I am working on that assumption.

Yes, if the code is available there, then there is no legal problem
obtaining it from that location and using it in Octave.

- Jordi G. H.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Terry Duell
In reply to this post by Terry Duell
Hello Carlo,

On Tue, 11 Dec 2012 21:44:09 +1100, Carlo de Falco  
<[hidden email]> wrote:

> 2012/12/10 Terry Duell <[hidden email]>:
>> I have been testing the any2csv.m from the google code site, and Octave
>> 3.6.3 doesn't like it.
>> There seems to be a number of problems, and I'm lacking knowledge in
>> figuring out why.
>> I will plod on, but it would be good if others with more knowledge can  
>> have
>> a look at it.
>
> can you post a simple example that is failning in Octave but works in
> Matlab, so we can check to see how much it take to adapt the code?

I can't check how it runs in Matlab. I can only assume, from the related  
history at Matlab Central, that it works OK in Matlab.
At this stage I'm guessing a fair bit with the changes I am trying, which  
is often the case when things don't work and it isn't clear what various  
parts of the code are meant to be doing.

I would suggest you run one of the examples given in the header comments.

Cheers,
--
Regards,
Terry Duell
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

bpabbott
Administrator
In reply to this post by Terry Duell

On Dec 10, 2012, at 5:28 PM, Terry Duell wrote:

> On Mon, 10 Dec 2012 16:44:52 +1100, Juan Pablo Carbajal <[hidden email]> wrote:
>
>> On Mon, Dec 10, 2012 at 12:18 AM, Terry Duell <[hidden email]>  wrote:
>
> [snip]
>
>>> The code is also available here...
>>>
>>> <http://code.google.com/p/ewh-bp-project/source/browse/trunk/bp-matlab-interface/any2csv.m?spec=svn7f9c995eee3c172e8e9f2c19f0153ead1099fde9&r=7f9c995eee3c172e8e9f2c19f0153ead1099fde9>
>>>
>>> Not sure if this satisfies the requirement.
>>> No response thus far from the original author
>
> [snip]
>
>> As far s I see that code is released under Modified BSD which is GPL
>> compatible and FSF kind of approves it
>> http://www.gnu.org/licenses/license-list.html#ModifiedBSD
>>
>> I think we can grab that function, without troubles.
>
> I have been testing the any2csv.m from the google code site, and Octave 3.6.3 doesn't like it.
> There seems to be a number of problems, and I'm lacking knowledge in figuring out why.
> I will plod on, but it would be good if others with more knowledge can have a look at it.
I see problems with the current developer's sources as well (default branch).  I've attached a comparison between Matlab and Octave.

Ben




_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave

result.txt (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Terry Duell
On Wed, 12 Dec 2012 14:49:46 +1100, Ben Abbott <[hidden email]> wrote:

[snip]

> I see problems with the current developer's sources as well (default  
> branch).  I've attached a comparison between Matlab and Octave.

Thanks for that. Those results are much better than I have been able to  
achieve thus far.
Do you mean that any2csv.m is now in the default branch, and being  
developed/tested?
If so, can you please point me to it. I have cloned the source but haven't  
been able to find it.

Cheers,
--
Regards,
Terry Duell
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

bpabbott
Administrator
On Dec 11, 2012, at 11:26 PM, Terry Duell wrote:

> On Wed, 12 Dec 2012 14:49:46 +1100, Ben Abbott <[hidden email]> wrote:
>
> [snip]
>
>> I see problems with the current developer's sources as well (default branch).  I've attached a comparison between Matlab and Octave.
>
> Thanks for that. Those results are much better than I have been able to achieve thus far.
> Do you mean that any2csv.m is now in the default branch, and being developed/tested?
> If so, can you please point me to it. I have cloned the source but haven't been able to find it.

No.  I ran Octave built using the default branch of the developers sources and ran any2csv from the google code web site.

Ben


_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Terry Duell
On Wed, 12 Dec 2012 15:51:08 +1100, Ben Abbott <[hidden email]> wrote:

> On Dec 11, 2012, at 11:26 PM, Terry Duell wrote:
>
>> On Wed, 12 Dec 2012 14:49:46 +1100, Ben Abbott <[hidden email]> wrote:
>>
>> [snip]
>>
>>> I see problems with the current developer's sources as well (default  
>>> branch).  I've attached a comparison between Matlab and Octave.
>>
>> Thanks for that. Those results are much better than I have been able to  
>> achieve thus far.
>> Do you mean that any2csv.m is now in the default branch, and being  
>> developed/tested?
>> If so, can you please point me to it. I have cloned the source but  
>> haven't been able to find it.
>
> No.  I ran Octave built using the default branch of the developers  
> sources and ran any2csv from the google code web site.

OK.
Did you have to make any changes to any2csv to get it to run and produce  
the results you provided?

Cheers,
--
Regards,
Terry Duell
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

bpabbott
Administrator
On Dec 11, 2012, at 11:59 PM, Terry Duell <[hidden email]> wrote:

> On Wed, 12 Dec 2012 15:51:08 +1100, Ben Abbott <[hidden email]> wrote:
>
>> On Dec 11, 2012, at 11:26 PM, Terry Duell wrote:
>>
>>> On Wed, 12 Dec 2012 14:49:46 +1100, Ben Abbott <[hidden email]> wrote:
>>>
>>> [snip]
>>>
>>>> I see problems with the current developer's sources as well (default branch).  I've attached a comparison between Matlab and Octave.
>>>
>>> Thanks for that. Those results are much better than I have been able to achieve thus far.
>>> Do you mean that any2csv.m is now in the default branch, and being developed/tested?
>>> If so, can you please point me to it. I have cloned the source but haven't been able to find it.
>>
>> No.  I ran Octave built using the default branch of the developers sources and ran any2csv from the google code web site.
>
> OK.
> Did you have to make any changes to any2csv to get it to run and produce the results you provided?

No.

Ben
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: strcells functionality in Octave?

Terry Duell
On Wed, 12 Dec 2012 23:41:50 +1100, Benjamin Abbott <[hidden email]>  
wrote:


>>> No.  I ran Octave built using the default branch of the developers  
>>> sources and ran any2csv from the google code web site.
>>
>> OK.
>> Did you have to make any changes to any2csv to get it to run and  
>> produce the results you provided?
>
> No.

Given the way it works on the a build from the current default branch, and  
the way it works here on 3.6.3, it looks to me as though it is a waste of  
time attempting to get the code to work on 3.6.3.

Cheers,
--
Regards,
Terry Duell
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave