Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

when I run this code I get Undefined function or variable 'U'.

1 visualización (últimos 30 días)
Rui Mauaie
Rui Mauaie el 4 de Nov. de 2018
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
for i=1:n
h=u(1:n,i:i);
b=a(i,1);
if b>0.0001
U(1:n,i:i)=h/sqrt(b);
end
end
[N,M]=size(U);
  1 comentario
Jan
Jan el 6 de Nov. de 2018
By the way, i:i is a waste of time. Use i only.

Respuestas (1)

Bruno Luong
Bruno Luong el 4 de Nov. de 2018
MATLAB makes distinction between upper case and lower case in variable name. If you call
[u,d,v]=svd(K);
then you have to use small u afterwards, or the opposite.
  4 comentarios
Jan
Jan el 6 de Nov. de 2018
@Rui Mauaie: And a copy of the complete error message.
Bruno Luong
Bruno Luong el 6 de Nov. de 2018
He also deleted the code he posted previously making my comment difficult to understand.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by