Count the numbers - MATLAB Cody - MATLAB Central

Problem 43058. Count the numbers

Difficulty:Rate

In a array x, count the number of times the number n appears in x.

for example: x = [1 2 3 4 3 2 1 2] and n = 2 the answer should be 3, because 2 appears 3 times in x

Solution Stats

78.89% Correct | 21.11% Incorrect
Last Solution submitted on May 05, 2025

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

Problem Recent Solvers70

Suggested Problems

More from this Author25

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page