# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1302589711 18000 # Node ID 47417d37c4db1cfb0c3f510cb6e62169e3315cc2 # Parent 732a568bf6947823fe3277ad8a110008f086bee9# Parent 4727fd4dd4bba6e79efcd0df3bca80b951e17016 Trivial merge of two stable heads diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2011-04-11 Ben Abbott + + * miscellaneous/getappdata.m: If appdata propery does not exist, return + an empty matrix. + 2011-04-08 Rik * linear-algebra/cond.m, linear-algebra/expm.m, linear-algebra/logm.m, diff --git a/scripts/miscellaneous/getappdata.m b/scripts/miscellaneous/getappdata.m --- a/scripts/miscellaneous/getappdata.m +++ b/scripts/miscellaneous/getappdata.m @@ -29,14 +29,20 @@ error ("getappdata: invalid input"); endif - appdata(numel(h)) = struct(); + ## FIXME - Is there a better way to handle non-existent appdata + ## and missing fields? + val = cell (numel (h), 1); + appdata = struct(); for nh = 1:numel(h) - appdata(nh) = get (h(nh), "__appdata__"); + try + appdata = get (h(nh), "__appdata__"); + catch + appdata.(name) = []; + end_try_catch + val(nh) = {appdata.(name)}; end - if (nh > 1) - val = {appdata.(name)}; - else - val = appdata.(name); + if (nh == 1) + val = val{1}; endif endfunction diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-04-10 John Eaton + + * graphics.cc (Fishandle) Accept vector of handles (bug #33025). + 2011-04-08 Rik * DLD-FUNCTIONS/balance.cc, DLD-FUNCTIONS/eig.cc, @@ -5,10 +9,6 @@ DLD-FUNCTIONS/sqrtm.cc, DLD-FUNCTIONS/svd.cc, data.cc: Improve docstrings. -2011-04-10 John Eaton - - * graphics.cc: Allow ishandle() to accept vector of handles (bug 33025). - 2011-04-06 Rik * DLD-FUNCTIONS/dmperm.cc, data.cc: Clean up operator and function