403 total contributions since 2017

Audio Engineer @Sony

Answered

I'm trying to create Random Music Player and could use help!

% clear all; close all; clc MusicList = dir('*.m4a'); while(1) r = randi(length(MusicList),1,1) [a, Fs] = audioread(...

I'm trying to create Random Music Player and could use help!

% clear all; close all; clc MusicList = dir('*.m4a'); while(1) r = randi(length(MusicList),1,1) [a, Fs] = audioread(...

2 mois ago | 0

| accepted

Answered

how can i avoid return to zero from my plot

Bitsnum = 11; dataIn = randi([0 1],1,Bitsnum); i = 1; count = 0; t = 0:.01:length(dataIn); for j =1:length(t) if t(j) ...

how can i avoid return to zero from my plot

Bitsnum = 11; dataIn = randi([0 1],1,Bitsnum); i = 1; count = 0; t = 0:.01:length(dataIn); for j =1:length(t) if t(j) ...

2 mois ago | 1

| accepted

Answered

Matlab Text file I/o

charnum = char_counter('simple.txt','a') function charnum = char_counter(a,b); f = fopen(a); c = textscan(f,'%s'); charnum...

Matlab Text file I/o

charnum = char_counter('simple.txt','a') function charnum = char_counter(a,b); f = fopen(a); c = textscan(f,'%s'); charnum...

2 mois ago | 0

Answered

Generate an array with random numbers from M to N using the command randi

function [R1, R2, c] = random_test(r, s, t) if length(r)==1 r(2) = r; r(1) = 1; end rng('default'); R1=randi([r(1)...

Generate an array with random numbers from M to N using the command randi

function [R1, R2, c] = random_test(r, s, t) if length(r)==1 r(2) = r; r(1) = 1; end rng('default'); R1=randi([r(1)...

2 mois ago | 1

Solved

Find the maximum number of decimal places in a set of numbers

Given a vector or matrix of values, calculate the maximum number of decimal places within the input. Trailing zeros do not coun...

3 mois ago

Solved

Make roundn function

Make roundn function using round. x=0.55555 y=function(x,1) y=1 y=function(x,2) y=0.6 y=function(x,3) ...

3 mois ago

Solved

Rounding off numbers to n decimals

Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...

3 mois ago

Solved

Matlab Basics - Rounding III

Write a script to round a large number to the nearest 10,000 e.g. x = 12,358,466,243 --> y = 12,358,470,000

3 mois ago

Solved

Matlab Basics - Rounding II

Write a script to round a variable x to 3 decimal places: e.g. x = 2.3456 --> y = 2.346

3 mois ago

Solved

Check that number is whole number

Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. <http://en.wikipedia.org/wiki/Whole...

3 mois ago

Solved

MATLAB Basic: rounding IV

Do rounding towards plus infinity. Example: -8.8, answer -8 +8.1 answer 9 +8.50 answer 9

3 mois ago

Solved

MATLAB Basic: rounding III

Do rounding towards minus infinity. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 8

3 mois ago

Solved

MATLAB Basic: rounding II

Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9

3 mois ago

Solved

MATLAB Basic: rounding

Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

3 mois ago

Solved

Sums with Excluded Digits

Add all the integers from 1 to n in which the digit m does not appear. m will always be a single digit integer from 0 to 9. no...

3 mois ago

Solved

Trimming Spaces

Given a string, remove all leading and trailing spaces (where space is defined as ASCII 32). Input a = ' singular value deco...

3 mois ago

Solved

Reverse Run-Length Encoder

Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

3 mois ago

Solved

Return a list sorted by number of occurrences

Given a vector x, return a vector y of the unique values in x sorted by the number of occurrences in x. Ties are resolved by a ...

3 mois ago

Solved

De-dupe

Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if a =...

3 mois ago

Solved

Balanced number

Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

3 mois ago

Solved

Making change

Given an amount of currency, return a vector of this form: [100 50 20 10 5 2 1 0.5 0.25 0.1 0.05 0.01] Example: Input a = ...

3 mois ago

Solved

What is the distance from point P(x,y) to the line Ax + By + C = 0?

Given a point, P(x,y), find the distance from this point to a linear line. INPUTS: x, y, A, B, C OUTPUTS: d, the distance ...

3 mois ago

Solved

Replace NaNs with the number that appears to its left in the row.

Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

3 mois ago

Solved

Binary numbers

Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

3 mois ago

Solved

Pangrams!

A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

3 mois ago

Solved

Remove all the consonants

Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

3 mois ago

Solved

Interpolator

You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

3 mois ago

Solved

Return the largest number that is adjacent to a zero

This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

3 mois ago

Solved

Is X a Fibonacci Matrix?

In honor of Cleve's new blog and post: <http://blogs.mathworks.com/cleve/2012/06/03/fibonacci-matrices/> Is X a Fibonacci ...

9 mois ago

Solved

Get the elements of diagonal and antidiagonal for any m-by-n matrix

In the problem <http://www.mathworks.com/matlabcentral/cody/problems/858-permute-diagonal-and-antidiagonal Problem 858. Permute ...

10 mois ago