Using Arrayfun for iterative plotting
古いコメントを表示
Hi all,
I'm trying to plot all the elements of a cell array using the command arrayfun instead of a for loop.
My cell array is the following:

It gives me error when I use this sintax:
arrayfun(@(x)plot(repmat(x{6,2:end},1,x{2,2:end}),x{7,2:end},Gen_Array))
Can anybody please help me with this?
Thank you very much,
Manuel
4 件のコメント
James Tursa
2019 年 5 月 15 日
For one, you didn't pass an array into arrayfun. All I see is the function handle.
Can you post explicitly what you are trying to plot in the 1st iteration? Then we can extrapolate an arrayfun syntax for you.
Jan
2019 年 5 月 15 日
@Manuel: Why do you prefer arrayfun instead of a clean loop? It will not be faster, but harder to create the code, as you see.
Manuel Arcangeletti
2019 年 5 月 16 日
Jan
2019 年 5 月 16 日
A loop is easier to write and to debug.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Programming についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!