generate number in particular way - MATLAB Cody - MATLAB Central

Problem 42845. generate number in particular way

Difficulty:Rate
    A = [1 5 2 7];
    MAX = 10;

generate a array

    Y = [1 2 2 2 2 2 3 3 4 4];

i.e. total element will be MAX in Y

Solution Stats

63.11% Correct | 36.89% Incorrect
Last Solution submitted on Jun 01, 2025

Problem Comments

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
2
3

Problem Recent Solvers111

Suggested Problems

More from this Author3

Problem Tags

Community Treasure Hunt

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

Start Hunting!