Need help making a plot from data in Excel with three columns and 2000 rows, to get two variables on the same axis.
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have an excel spreadsheet that I need to plot for a time response question that includes three columns of data and 2000 rows. The 2nd and 3rd column need to be on the same x-axis, and I cannot figure out how to get the spreadsheet referenced into the script as well as I do not know the correct functions. I know the basic functions to get a normal plot, but since there is this much data and 3 variables, I am lost on what goes into the script. I am able to import the data into MATLAB but not the code.
0 commentaires
Réponses (1)
dpb
le 5 Oct 2022
Size of data is of no matter to syntax -- if you can plot a vector of 5 elements, you can plot one of thousands...
data=readmatrix(fullfile('YourDataDirectory','YourFile.xlsx')); % read the data as an array
plot(data(:,1),data(:,2:3))
Done except for x/y labels, title, etc., etc., ...
0 commentaires
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!