split and plot data loop
古いコメントを表示
I have a dataset of 3 columns, and 221488 columns. In the first and second column is the x and y data, the third column is the name of the series, each series consist of 1000-4000 rows. how do i plot each x and y data for each different series and different color each plot using loop?
回答 (1 件)
Guillaume
2018 年 7 月 12 日
One possible way:
[group, seriesname] = findgroup(yourdataset.nameofthirdcolumn);
figure; %create figure;
hold on;
splitapply(@(x, y, g) plot(x, y, 'DisplayName', seriesname{g(1)}), yourdataset.x, yourdataset.y, group, group); %the repeat of group is intentional. 'DisplayName' assumes that series name are char arrays
カテゴリ
ヘルプ センター および File Exchange で 2-D and 3-D Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!