How can I automatically fill in the legend?
Mostra commenti meno recenti
Hi all,
I was wondering how I can automatically fill in my legend of a plot with the names of the files I load regarding excel-files (those contain numerical matrices). The code I'm using is:
material = {xlsread('dp600_2_layers_L50.xlsx',4),xlsread('dp600_3_layers_L50.xlsx',4),xlsread('dp800_3_layers_L50.xlsx',4)};
legend(material);
Clearly, I want to name the first line "dp600_2_layers_L50", the second line "dp600_3_layers_L50", etc. The error which Matlab returns is "Cell array argument must be a cell array of strings.", which seems logical. Is there any way to work around this, or do I have to fill in the legend manually each time I change the input files?
Thank you all in advance!
Thomas
Risposta accettata
Più risposte (1)
Thomas Schot
il 4 Mag 2016
0 voti
Categorie
Scopri di più su Legend in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!