/
proof-of-concept
/
bead-percussion
Jump to
/
Appearance
Match my system
Paper
GitHub
Slate
Midnight
Terminal
Sign in
proof-of-concept
/
bead-percussion
Code
Commits
Issues
0
Pull requests
0
Branches
1
Tags
0
0330c41
Branches
main
bead-percussion
/
matlab
/
helpers
/
bp_chain.m
8 lines · 297 B
Copy
Copied
Blame
History
Raw
1
function [pos, E] = bp_chain(n, len)
2
% BP_CHAIN A straight line of n beads along x, from
0
to len.
3
% [pos, E] = bp_chain(n, len) returns positions (n-by
-3
) and the n
-1
4
% neighbor pairs E. The end beads are
1
and n.
5
x = linspace(
0
, len, n)
';
6
pos = [x, zeros(n, 2)];
7
E = [(1:n-1)'
, (
2
:n)
'];
8
end
9
↑
↓
move
↵
open
esc
close