how to do this

if I have i = 1:12 , j= 1:12 and I want to get a table with A(i,j) , how I will do it

2 comentarios

Igor de Britto
Igor de Britto el 8 de Mzo. de 2012
I don't get your question. Wich values do you want to populate this square matrix? Or do you want a lot of matrices with all the size combinations?
Nasir Qazi
Nasir Qazi el 8 de Mzo. de 2012
I want to access each entry on excel sheet using Matlab , in Matlab I want to just enter A(i,j) and it should acess excel sheet for the values of i , j and return it back to Matlab , How can I do that

Iniciar sesión para comentar.

Respuestas (3)

Walter Roberson
Walter Roberson el 8 de Mzo. de 2012

0 votos

What do you mean by a "table" in this context? Something displayed to the command window? A uitable() ? An array with 3 columns, the first for i, the second for j, and the third for A(i,j) ?
When you speak of A(i,j) do you mean A(1:12,1:12), or do you mean A(i(1),j(1)) A(i(2),j(2)), A(i(3),i(3)) and so on? If you do then
A(subs2ind(size(A), i, j))

5 comentarios

Nasir Qazi
Nasir Qazi el 8 de Mzo. de 2012
check this excel diagram
http://imageshack.us/photo/my-images/141/newpicturezp.jpg/
I want to access every data set on the excel sheet .
Walter Roberson
Walter Roberson el 8 de Mzo. de 2012
I only see one data set in that diagram. Do you mean you want to access each entry? As a group that would be A(1:12,1:12).
Do you want to use a loop?
for i = 1 : 12
for j = 1 : 12
disp(A(i,j)); %the sample action taken on A(i,j)
end
end
Or is the question how to take an existing matrix and write it to an Excel spreadsheet?
Nasir Qazi
Nasir Qazi el 8 de Mzo. de 2012
I want to access each entry on excel sheet using Matlab , in Matlab I want to just enter A(i,j) and it should acess excel sheet for the values of i , j and return it back to Matlab , How can I do that
Nasir Qazi
Nasir Qazi el 8 de Mzo. de 2012
syms A
>> for i = 1 : 12
for j = 1 : 12
disp(A(i,j)); %the sample action taken on A(i,j)
end
end
A
??? Error using ==> mupadmex
Error in MuPAD command: Index exceeds matrix dimensions.
Error in ==> sym.sym>sym.subsref at 1366
B = mupadmex('mllib::subsref',A.s,inds{:});
Nasir Qazi
Nasir Qazi el 8 de Mzo. de 2012
without syms A
??? Undefined function or method 'A' for input arguments of type 'double'.

Iniciar sesión para comentar.

Nasir Qazi
Nasir Qazi el 8 de Mzo. de 2012

0 votos

check this excel diagram http://imageshack.us/photo/my-images/141/newpicturezp.jpg/ I want to access every data set on the excel sheet .
Nasir Qazi
Nasir Qazi el 8 de Mzo. de 2012

0 votos

I want to access each entry on excel sheet using Matlab , in Matlab I want to just enter A(i,j) and it should acess excel sheet for the values of i , j and return it back to Matlab , How can I do that

2 comentarios

Aldin
Aldin el 8 de Mzo. de 2012
You want to display excel data in uitable, right?
Nasir Qazi
Nasir Qazi el 8 de Mzo. de 2012
yes

Iniciar sesión para comentar.

Categorías

Más información sobre Data Import from MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 8 de Mzo. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by