Is there ang function like Map, MapThread in Mathematica

1 回表示 (過去 30 日間)
Ziyu Zhao
Ziyu Zhao 2019 年 3 月 2 日
回答済み: Walter Roberson 2019 年 3 月 2 日
In Mathematica, there are functions like Map, Mapthread, Apply which are powerful when dealing with list
I was wondering are there functions in Matlab , for example
If I want to display several image
I could write code like this:
name_list=["img1","img2","img3"];
img_list={img1,img2,img3};
for i=numel(img_lis)
figure
imshow(img_list{i})
title(name_list(i))
end
If there are functions like MapThread in mathematica, I could just write one line of code like (figure,imshow(#1),title(#2))&/@{img_list,name_list} (this is mathematica style)

採用された回答

Walter Roberson
Walter Roberson 2019 年 3 月 2 日
arrayfun() can help, but you would need to pass a function handle. You would need to write a real function to do the work, because anonymous functions can only chain together multiple commands in contrived ways.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by