Ask
your own question, for FREE!
Computer Science
14 Online
What does this error in MATLAB mean? Attempted to access z(4); index out of bounds because numel(z)=2.
Still Need Help?
Join the QuestionCove community and study together with friends!
numel gives you the NUMber of ELements. If numel(z) is two, then there is no element z(4), only elements z(1) and z(2). That's why it says index out of bounds. The index (which is 4) does not fit between the bounds of 1 and 2.
How do I create elements z(3) and z(4) then?
Of course, it depends on what kind of data you want in them. If you want them zero, you could just say `z(3:4) = 0;`
Can't find your answer?
Make a FREE account and ask your own questions, OR help others and earn volunteer hours!
Join our real-time social learning platform and learn together with your friends!
Join our real-time social learning platform and learn together with your friends!
Latest Questions
VERNEISH:
Two objects are moving along separate linear paths where each path is described by position, d, and time, t.
Maci:
what are the best stock apps for people who want to start investing?
Twaylor:
genuienly how do i get better self control i keep watcing youtube and theres this
IzzyCookie:
|dw:1792074056138:dw| Uhm, I don't know where to ask this, but I'm in college welding at my community college, and I need help learning vertical welding for
thehearken:
not sure if this is considered spam, im sorry if it is, but does anyone have tips
5 hours ago
1 Reply
0 Medals
4 days ago
3 Replies
2 Medals
1 week ago
3 Replies
0 Medals
2 days ago
9 Replies
1 Medal
1 week ago
2 Replies
1 Medal