Error with inverse of a matrix
21 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ester Yang
am 23 Okt. 2019
Beantwortet: Artemio Soto Breceda
am 23 Okt. 2019
Index exceeds the number of array elements (400).
inv2 = inv(A);
All I did was the line above here, and I defined A as a
A = vander(1:20);
What's wrong ?
0 Kommentare
Akzeptierte Antwort
Artemio Soto Breceda
am 23 Okt. 2019
There is nothing wrong with that code, but it looks like prior to it, you are assigning a value to inv. I.e. you create a variable called 'inv', hence when you want to use the function, Matlab thinks you want to call the variable instead. Make sure you read the whole error, which should look like this:
'inv' appears to be both a function and a variable. If this is unintentional, use 'clear inv' to remove the variable 'inv' from the workspace.
To fix your code just change the name of the variable inv to something like inv_1or inv1. If you still have the problem, clear the workspace with:
>> clear
or
>> clear inv
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra 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!