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?

Risposte (1)

Guillaume
Guillaume il 12 Lug 2018
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

Categorie

Scopri di più su 2-D and 3-D Plots in Centro assistenza e File Exchange

Tag

Richiesto:

il 12 Lug 2018

Risposto:

il 12 Lug 2018

Community Treasure Hunt

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

Start Hunting!

Translated by