Skip to content
Snippets Groups Projects
Commit f7476055 authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

ajout des methodes subsasgn.m et subsref.m

parent abc193f1
No related branches found
No related tags found
No related merge requests found
function hash = subsasgn(hash,index,val)
switch index.type
case '()'
if (length(index.subs) ~= 1)
error('Only single indexing is supported.');
end
hash = put(hash,index.subs{1},val);
case '.'
hash = put(hash,index.subs,val);
otherwise
error('Invalid type.')
end
function val = subsref(hash,index)
switch index.type
case '()'
if (length(index.subs) ~= 1)
error('Only single indexing is supported.');
end
val = get(hash,index.subs{1});
case '.'
val = get(hash,index.subs);
otherwise
error('Invalid type.')
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment