How to plot data sequences from multiple files in a loop?

1 回表示 (過去 30 日間)
Mir Lodro
Mir Lodro 2018 年 11 月 29 日
回答済み: Mir Lodro 2018 年 11 月 30 日
Hi,
I have 10 txt data files and I want to plot data from each file after performing opertations on 3D plot. I have given a with 2D plot it works fine. My question is how to plot the same data as 3D using surf or plot3 command. I want to add 3rd dimension which represents number of snapshots. There are 10 files, each file has 214 data samples. Please see attachment:
Screen Shot 2018-11-29 at 18.45.34.png
  4 件のコメント
Luna
Luna 2018 年 11 月 29 日
I am thinking there should be a .txt attachment above the code shows that.
Jan
Jan 2018 年 11 月 30 日
@Mir: Prefer to post code as text, because then suggesting modifications can be done by copy&paste. It is tedious to type the shown code again, most of all because you do have this code as text already.

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

回答 (2 件)

Jan
Jan 2018 年 11 月 30 日
What about:
plot3(mydata{k}(:, 2), k, mag);
Omit the shg and axis tight commands inside the loop, because here they waste time only.

Mir Lodro
Mir Lodro 2018 年 11 月 30 日
Thanks, i solved the problem.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by