Help with {} construction rules

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

Help with {} construction rules

Rik-4
12/30/14

Can someone run the following code under Matlab and send back the diary
file?  I believe that Matlab is checking every element for being empty and
discarding any it finds (https://savannah.gnu.org/bugs/?43113).

diary on
{1, 2 ; ; 3, 4}
{1, 2 ; [] ; 3, 4}
{1, 2 ; [], [] ; 3, 4}
{1, 2 ; [], [], []; 3, 4}
{1, 2 ; [], [], 5; 3, 4}
{1, 2 ; [], 5, [], 6; 3, 4}
{1, 2 ; [], 5, [], 6, 7; 3, 4}
{1, 2 ; {}; 3, 4}
{1, 2 ; {}, {}; 3, 4}
{1, 2 ; {}, {}, {}; 3, 4}
{1, 2 ; {}, {}, 5; 3, 4}
{1, 2 ; '', 5; 3, 4}
{1, 2 ; '', '', ''; 3, 4}
diary off

Thanks,
Rik


Reply | Threaded
Open this post in threaded view
|

Re: Help with {} construction rules

Julien Bect
Le 31/12/2014 17:19, Rik a écrit :
> 12/30/14
>
> Can someone run the following code under Matlab and send back the diary
> file?  I believe that Matlab is checking every element for being empty and
> discarding any it finds (https://savannah.gnu.org/bugs/?43113).

% Matlab doesn't discard empty elements
% For example, in Matlab R2012a

 >> {[], [], []}

ans =

     []    []    []

> diary on
> {1, 2 ; ; 3, 4}
> {1, 2 ; [] ; 3, 4}

 >> {1, 2 ; [] ; 3, 4}
Error using vertcat
CAT arguments dimensions are not consistent.


Reply | Threaded
Open this post in threaded view
|

Re: Help with {} construction rules

Rik-4
On 12/31/2014 08:34 AM, Julien Bect wrote:
Le 31/12/2014 17:19, Rik a écrit :
12/30/14

Can someone run the following code under Matlab and send back the diary
file?  I believe that Matlab is checking every element for being empty and
discarding any it finds (https://savannah.gnu.org/bugs/?43113).

% Matlab doesn't discard empty elements
% For example, in Matlab R2012a

>> {[], [], []}

ans =

    []    []    []

diary on
{1, 2 ; ; 3, 4}
{1, 2 ; [] ; 3, 4}

>> {1, 2 ; [] ; 3, 4}
Error using vertcat
CAT arguments dimensions are not consistent.


Is this also true for empty cell elements, the tests at the bottom of my list?

{ {}, {}, {} }
{1, 2; {}; 3, 4}

--Rik

Reply | Threaded
Open this post in threaded view
|

Re: Help with {} construction rules

Julien Bect
Le 31/12/2014 18:02, Rik a écrit :
> Is this also true for empty cell elements, the tests at the bottom of
> my list?
>
> { {}, {}, {} }
> {1, 2; {}; 3, 4}

 >> { {}, {}, {} }

ans =

     {}    {}    {}

 >> {1, 2; {}; 3, 4}
Error using vertcat
CAT arguments dimensions are not consistent.