Randperm without the number 1

1 回表示 (過去 30 日間)
Mary Hemler
Mary Hemler 2020 年 5 月 14 日
回答済み: Stephen23 2020 年 5 月 14 日
I am trying to do an asynchronous, random order update for a Hopfield neural network. Here is my code:
S=U;
Async=randperm(50);
m19(1)=(S*U')/N;
for t= Async(2:end)
h(t)=(W2(t,:)*S')/N;
S(t)=sign(h(t));
m19(t)=(S*U')/N;
end
figure
plot(m19)
title('Overlap between S and U with W2')
However, I need to make it so that the number 1 is not included in the code for Async (because I need to use the number 1 to calculate m(19) - the overlap - then need all numbers after 1 to be random).

採用された回答

Stephen23
Stephen23 2020 年 5 月 14 日
1+randperm(50-1)

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by