Filter löschen
Filter löschen

Error taking inverse of a matrix

3 Ansichten (letzte 30 Tage)
cdob
cdob am 20 Mär. 2015
Kommentiert: Roger Stafford am 20 Mär. 2015
Hi,
I am receiving the error, "Subscript indices must either be real positive integers or logicals", when I attempt to take the inverse of a matrix. Can somebody please help me? Here is my code:
C = xlsread('OP_data.xlsx'); D = C;
y = log(C(:,3));
D(any(C==0,2),:)=[]; y(any(C==0,2),:)=[];
X = [ones(size(D,1),1),log(D(:,5)),log(D(:,6))];
Beta = inv(X'*X)*(X'*y);
Any help would be greatly appreciated!
  1 Kommentar
Roger Stafford
Roger Stafford am 20 Mär. 2015
Somewhere in your system there may be a variable with the name 'inv', which causes matlab to misinterpret your line "Beta = inv(X'*X)*(X'*y);". Try doing a
whos
to see if 'inv' shows up.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by