Effacer les filtres
Effacer les filtres

Issue with matrix dimensions

1 vue (au cours des 30 derniers jours)
Mohammed Darwish
Mohammed Darwish le 17 Juil 2018
Commenté : Mohammed Darwish le 17 Juil 2018
I am getting and error "index exceeds matrix dimension". I am just loading a .mat file which has 2 equal sized coloums and placing the values of each coloum in a varialble. I did not define an index, for example to loop over the matrix. Any ideas why I get this error ?
mu_Au = 0;
mu_Si = 0;
k_B = 8.6173303e-5;
T = 300;
e0= 1.6021766e-19;
h = 6.62607e-34;
func_fermi = @(E,mu) 1./(1 + exp((E-mu)/(k_B*T)));
TE1 = load('TransmissionA1.mat');
E = TE1(:,1); TP = TE1(:,2);

Réponse acceptée

KSSV
KSSV le 17 Juil 2018
TE1 = load('TransmissionA1.mat');
Check TE1 will be a structure. You cannot access it like you did. Try:
S = load('TransmissionA1.mat');
TE1 = S.TE1 ;
E = TE1(:,1); TP = TE1(:,2);
  1 commentaire
Mohammed Darwish
Mohammed Darwish le 17 Juil 2018
Thank you KSSV !!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by