problem with reading data from excel

1 view (last 30 days)
Hello everyone,
let say I have an excel file say.
x1/x2 1 2 3 4 5
1 4 12 45 54 48
2 6 15 20 59 62
3 7 17 25 60 78
4 8 19 26 62 80
5 9 20 27 64 86
so now i am getting some values of x1 and x2 and i want that the code should read a particular value for x1 and x2. For example
x1=2, x2=4, ans=59
x1=3, x2= 5, ans=78
so is this possible that code itself read data for .mat file or excel file

Accepted Answer

Alex Mcaulley
Alex Mcaulley on 20 Aug 2019
Do you mean this?
data = xlsread('yourExcel.xlsx');
data = data(2:end,2:end)
data(2,4) %For example: x1 = 2; x2 = 4

More Answers (0)

Categories

Find more on Data Import from MATLAB in Help Center and File Exchange

Tags

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!