Need help making a plot from data in Excel with three columns and 2000 rows, to get two variables on the same axis.
3 views (last 30 days)
Show older comments
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 Comments
Answers (1)
dpb
on 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 Comments
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!