Specific Element Count - MATLAB Cody - MATLAB Central

Problem 367. Specific Element Count

Difficulty:Rate

Given a vector v and a element e, return the number of occurrences of e in v.

Note: NaNs are equal and there may be no occurrences of e in v

Example:

v = 1:10
e = 2
output = 1

Solution Stats

29.8% Correct | 70.2% Incorrect
Last Solution submitted on May 08, 2025

Problem Comments

Solution Comments

Show comments
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
3

Group

Indexing I Image
Indexing I
  • 27 Problems
  • 237 Finishers

Problem Recent Solvers896

Community Treasure Hunt

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

Start Hunting!
Go to top of page