How do i fix the error that i am getting?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Taylor
el 13 de Jul. de 2023
Comentada: Torsten
el 13 de Jul. de 2023
My code is
A = [1,1,0,2,0;0,1,1,3,0;2,0,0,0,1;3,1,0,2,1;2,1,1,3,0;1,0,0,2,1]
rrefA = rref(A)
basisRowSpace = A(rrefA(:,end)~=0,:)
pivotColumns = rrefA(:,1:end-1)
basisColumnSpace = A(:,pivotColumns)
This is where it stops working and I dont know how to fix it.
The error that I get is Index in postion 2 is invails. Array indices must be postive integers or logical values.
I would appricate any help to be able to fix this and get it to run.
Thank You.
0 comentarios
Respuesta aceptada
Torsten
el 13 de Jul. de 2023
Movida: Torsten
el 13 de Jul. de 2023
Remove the semicolon behind the line
pivotColumns = rrefA(:,1:end-1);
execute the code and see if it makes sense to insert the displayed matrix in
basisColumnSpace = A(:,pivotColumns);
7 comentarios
Torsten
el 13 de Jul. de 2023
Ok, that's what "licols" does. The maximum number of independent columns of A is a basis for the column space of A.
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!