Plot multiple workspace in a for loop

I am dealing with many files that I loaded into matlab. The corresponding workspaces are named A1, A2, A3...A297. The workspaces do not have equal number of rows but all have 2 columns. I would like to plot all of the workspaces in the same plot preferably in a for loop so I don't have to manually plot all workspaces.
What would be the best or most efficient way of doing this?

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 5 月 8 日

0 投票

figure;
hold on
for k=1:297
data=eval(sprintf('A%d',k))
plot(data(:,1),data(:,2))
end
hold off

1 件のコメント

Gokul
Gokul 2013 年 10 月 30 日
When I try this code for my workspaces and try running them, I get a graph with no Points(plots) in my graph. Is there any other solution?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

質問済み:

2013 年 5 月 8 日

コメント済み:

2013 年 10 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by