Abdulhameed
Abdulhameed

Reputation: 210

How could this file be stored in matlab

I have this excel file attached, I am wondering how I could store it in matlab such that I could refrence it as A.AX, B.BY etc. What is the fastest way to do this. Or could I convert the excel file to a matlab file?enter image description here

Upvotes: 0

Views: 68

Answers (2)

user1543042
user1543042

Reputation: 3442

I saw that you already accepted, but here is another option

data = xlsread('Book1.xlsx');

a = data(:,1:4) ;
b = data(:,6:9) ;
c = data(:,11:14) ;

A = cell2struct( num2cell(a, 1) , {'AW', 'AX', 'AY', 'AZ'}, 2);
B = cell2struct( num2cell(b, 1) , {'BW', 'BX', 'BY', 'BZ'}, 2);
C = cell2struct( num2cell(c, 1) , {'CW', 'CX', 'CY', 'CZ'}, 2);

Upvotes: 1

a.payne
a.payne

Reputation: 61

One way to do this is to import each column in row 3 of your doc as a matrix and then format them into tables named(A, B, C...) For example:

AW = [148;174;177;217;280;145;291]; % Entries in column AW
AX = [376;360;553;390;464;359;411]; % Entries in column AX
A = table(AW,AX); % AW and AX are put into table named A

You can then easily acces each value or column by for example A.AW(1) or A.AW(:) etc.

The final table looks like this:

Final table looks like this

Upvotes: 1

Related Questions