Making a graph with multiple different colors

2 visualizzazioni (ultimi 30 giorni)
Alexander
Alexander il 25 Apr 2023
Commentato: Cris LaPierre il 25 Apr 2023
I am trying to make a graph where the x values is "number" and the y values are " Amplitude, PSD, Recurrance_Rate, Recurrance_Points, Determinism, Ratio_Determinism_Recurrance_Rate, Average_Diagonal_Length, Average_Vertical_Length, Laminarity, Divergence, Entropy, Trapping_Time, OSA_Label" with different colors for each one. This is the code i have so far.
data = xlsread('project.xlsx')
Number = data(:, 1)
Amplitude = data(:, 2)
PSD = data(:, 3)
Recurrance_Rate = data(:, 4)
Recurrance_Points = data(:, 5)
Determinism = data(:, 6)
Ratio_Determinism_Recurrance_Rate= data(:, 7)
Average_Diagonal_Length = data(:, 8)
Average_Vertical_Length = data(:, 9)
Laminarity = data(:, 10)
Divergence = data(:, 11)
Entropy = data(:, 12)
Trapping_Time= data(:, 13)
OSA_Label = data(:, 14)
The data waas originally in an excel spreadsheet and i assigned each column its own name. Please help
  2 Commenti
Alexander
Alexander il 25 Apr 2023
i basically have an excel spreadsheet with 14 columbs and 1085 rows and need to find a way to compare it all. Any suggestions?

Accedi per commentare.

Risposte (1)

Cris LaPierre
Cris LaPierre il 25 Apr 2023
Just use plot with a legend
data = readmatrix('project.xlsx')
varNames = ["Number","Amplitude","PSD","Recurrance_Rate","Recurrance_Points","Determinism","Ratio_Determinism_Recurrance_Rate","Average_Diagonal_Length","Average_Vertical_Length","Laminarity","Divergence","Entropy","Trapping_Time","OSA_Label"];
plot(data)
colororder(parula(length(varNames)));
legend(varNames)
  3 Commenti
Kevin Holly
Kevin Holly il 25 Apr 2023
You can convert the matrix into a table, which will make it compatible as an input to many functions that can do what you mentioned.
data = readmatrix('project.xlsx')
Tbl = array2table(data);
varNames = ["Number","Amplitude","PSD","Recurrance_Rate","Recurrance_Points","Determinism","Ratio_Determinism_Recurrance_Rate","Average_Diagonal_Length","Average_Vertical_Length","Laminarity","Divergence","Entropy","Trapping_Time","OSA_Label"];
Tbl.Properties.VariableNames = {varNames}
Are you doing a classification or regression problem and need to perform machine learning? If so, you could use the Classification Learner app or the Regression Learner App depending on what you would want to do. See video below:
Cris LaPierre
Cris LaPierre il 25 Apr 2023
Or just use readtable.
Your question seems to be wandering from the original one on creating a graph with multiple lines. What is the new question?

Accedi per commentare.

Categorie

Scopri di più su Statistics and Machine Learning Toolbox in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by