using containers.Map variable to hold ArrayDeque

I'd like to set up a Map variable (hash) where each entry would hold a list - ideally, I'd like to have each entry be a java ArrayDeque because then I can push and pop items easily. I've tried:
import java.util.ArrayDeque;
fromid=containers.Map;
currentid='00323';
fromid(currentid)=ArrayDeque;
fromid(currentid).push(100);
this line gives an error Error using ==> subsref One or more output arguments not assigned during call to "push"
But, the command works
fromid(currentid)
gives
ans=
[100.0]
and
fromid(currentid).pop
returns
100
I've tried pushing and popping several values and it works, I'd like to get rid of the Error though so I can use the approach in a script.
Thanks-

 採用された回答

Walter Roberson
Walter Roberson 2011 年 4 月 15 日

0 投票

I wonder... would it work to use
push(fromid(currentid),100)
??

その他の回答 (1 件)

Howard Reeves
Howard Reeves 2011 年 4 月 15 日

0 投票

Yes it works - thanks! HWR

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

製品

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by