Problem 6. Select every other element of a vector
Solution Stats
Problem Comments
-
35 Comments
Not clear.
What does it mean? It is not clear
It's not understandable.
This problem is definitely not clear.
Select the first, the third, the fifth, the seventh, ... element.
nice problem
I cant understand this problem.
nice
All solutions with score 10 or 11 use the regexp cheat.
very good one
Yes, you should change the redaction of the problem,maybe
function y = everyOther(x)
for i=1:length(x)
if mod(x(i),2)~=0
y(i)=x(i)
end
end
y=y(y>0)
end
What's wrong with this solution?
y = x(mod(x,2)==1);
it's not working, and i cant see why
nice problem
nice
good
I can't understand, why is this wrong?
j=1;
for i=1:length(x)
if rem(x(i),2)~=0
y(j)=x(i);
j=j+1;
end
end
Nice problem, but I have been doing this with my son and it would be good if the exercises were more gently graduated with relevant syntax so he can learn without relying on his dad knowing Matlab!
I can't believe someone solved this with size 9.
The leading solution is not a solution. It just makes all the test assertions true.
Indexing is one of more important things in matlab and matrices. Gotta learn them good before heading on.
Helo, hey hey ey
Indexing is one of more important things in matlab and matrices. Gotta learn them good before heading on.
Test suite suggests solution !
nice
the example made confusion
cool!
nice!
cool!
hard
I overcomplicated this one at first, but once you figure it out, it's not too bad
Absolutely mind boggling
this one's pretty good
gg ez
I have a question is that :test6 and test7 is the column vector,but test1-5 is the row vector,
so if test 1-5 are passed ,the test 6 and 7 are not passed
Solution Comments
Show commentsProblem Recent Solvers29640
Suggested Problems
-
Remove the small words from a list of words.
1306 Solvers
-
Find state names that start with the letter N
1126 Solvers
-
640 Solvers
-
723 Solvers
-
Solve a System of Linear Equations
9763 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!