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

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 件のコメント

Jan
Jan 2018 年 11 月 6 日
By the way, i:i is a waste of time. Use i only.

回答 (1 件)

Bruno Luong
Bruno Luong 2018 年 11 月 4 日

1 投票

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 件のコメント

Rui Mauaie
Rui Mauaie 2018 年 11 月 6 日
I already got the answer I changed the type of letter but I got the same error, thanks.
Stephen23
Stephen23 2018 年 11 月 6 日
@Rui Mauaie: please show us the complete code that you used.
Jan
Jan 2018 年 11 月 6 日
@Rui Mauaie: And a copy of the complete error message.
Bruno Luong
Bruno Luong 2018 年 11 月 6 日
He also deleted the code he posted previously making my comment difficult to understand.

この質問は閉じられています。

質問済み:

2018 年 11 月 4 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by