How can I create a loop to import multiple ranges from one excel spreasheet ?

1 view (last 30 days)
Hello,
I have a slight issue with importing data from an excel file into MATLAB. I need to import multiple ranges but I am unaware of how to set it up in a loop.
My objective: import CFD data from excel in order to organise it.
What my code looks like at the moment:
----------
filename= 'Results.xlsx'; sheet = 1;
uVRange1 = 'A154:J156';
iRow1= xlsread(filename, sheet, uVRange1);
iRow1NEW=reshape(iRow1, [1,30]);
-
uVRange2 = 'A157:J159';
iRow2= xlsread(filename, sheet, uVRange2);
iRow2NEW=reshape(iRow2, [1,30]);
-
uVRange3 = 'A160:J162';
iRow3= xlsread(filename, sheet, uVRange3);
iRow3NEW=reshape(iRow3, [1,30]);
-
uVRange4 = 'A163:J165';
iRow4= xlsread(filename, sheet, uVRange4);
iRow4NEW=reshape(iRow4, [1,30]); .......
-
[not of any importance to the problem but, i is the coordinate, uV: u velocity]
I need to be able to repeat this process approximately 50 times but it would take me a long time to type it all up.
Thank you for taking the time to look at my question.

Answers (0)

Categories

Find more on Data Import from MATLAB 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!