Risolto


So many choices
For inputs _n_ and _k_ (in that order), output the number of ways that k objects can be chosen from amongst n distinct objects. ...

circa un mese fa

Risolto


Get the variable value from a string and generate sum
Get the variable value from a string. Example. x = 'A=10' y = 'B=20' Result = (x+y) Result = 30

circa un mese fa

Risolto


Filter AC, pass DC
Input x is the sampled signal vector, may have both AC and DC components. Output vector y should not contain any AC component. ...

circa un mese fa

Risolto


TingTing
Output logical "true" if the input is the answer to luck and money$$$. Otherwise, output logical "false".

circa un mese fa

Risolto


Back to basics 25 - Valid variable names
Covering some basic topics I haven't seen elsewhere on Cody. Given a string, return true if it is a valid MATLAB variable nam...

circa un mese fa

Risolto


Even Sum
Calculate the sum of all even numbers between 1 and a given positive integer n. Write a function that takes n as input and retur...

circa un mese fa

Risolto


Perl 4: unshift
_This is part of a series of perl function which were very helpful for many perl programmers. Could you implement it in Matlab?_...

circa un mese fa

Risolto


struct2values()
Convert a struct object into a column vector. You can assume that the struct elements are scalars Example: a = struct();...

circa un mese fa

Risolto


Vector Linear sum: (p1-m1)V1+(p2-m2)V2+...(pK-mk)Vk
Calculate the sum of a Vector times coefficients expressed as two strings. Example: Normal representation [ a b c ], [ p1 ...

circa un mese fa

Risolto


Count of Unique Elements of a Vector
Count the number of times each unique element appears in a vector. Example: Input x = [2 9 1 2 4 9 2] Output y = [1 1; 2 3; 4...

circa un mese fa

Risolto


Remove the row average (★★★)
(copy of Prob. 963) Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solut...

circa un mese fa

Risolto


[Master Regular Expression] Vowel-Consonant Score
You are given a string s consisting of lowercase English letters, spaces, and digits. Let v be the number of vowels in s and c ...

circa un mese fa

Risolto


Back to basics 14 - Keywords
Covering some basic topics I haven't seen elsewhere on Cody. Return a cell array of all MATLAB keywords

circa un mese fa

Risolto


Create a matrix from a cell
In this problem , you must convert a cell into a matrix and pad each cell with NaN. *Example 1:* If you have the input...

circa un mese fa

Risolto


Find the shortest distance between a point and a straight line.
Given the Cartesian coordinates of three points A, B and C (in a flat Euclidean space), find the shortest distance between the ...

circa un mese fa

Risolto


All your base are belong to us
Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

circa un mese fa

Risolto


Repeat elements of a vector
Repeat each elements of a given vector according to their values. * x=[1,2,1,3] * y=[1,2,2,1,3,3,3]

circa un mese fa

Risolto


Is my wife right?
Regardless of input, output the string 'yes'.

circa un mese fa

Risolto


Vector slither sort!
Sort a numeric vector in the following format: [largest value, smallest value, second largest value, second smallest value, etc...

circa un mese fa

Risolto


R2012b atan in Degrees
Return in degrees the atan result of inputs for all four quadrants. *Examples:* [x, y] Degrees 1 0 0 1 1 ...

circa un mese fa

Risolto


Creating a code via test suite :)
Given the test suites, create a code that would fit them :) *Clue: Pascal's Triangle

circa un mese fa

Risolto


Vector with a repeated entry
Create a row vector of length n, filled with 4's. For example, if n = 3, output = [4 4 4]

circa un mese fa

Risolto


Compare a value to a vector
Given a random value X and a random vector Y. you have to compare X to the Vector Y and make a decision. case 1: X is a value i...

circa un mese fa

Risolto


Adding and Subtracting UINT variables
Given UINT class variables output the correct solution to A-B+C. *Input:* A,B,C Three uint variables *Output:* solution ...

circa un mese fa

Risolto


Fermat's last theorem - again
For a given integer n, express it as a sum of two squares if possible. Return empty matrix otherwise. Solution may not be unique...

circa un mese fa

Risolto


'X'avier
Given a square matrix A of size n, write a function to create a new matrix B where only the elements on the main diagonal and th...

circa un mese fa

Risolto


How many hours are there in a day in Italy?
Remember "European Summer Time"

circa un mese fa

Risolto


Make the first letter of a sentence Capital.
In this problem you will be given a string of 2 or 3 lines. Your work is to make the first letters of every line Capital. You wi...

circa un mese fa

Risolto


Vectorize the digits of an Integer
Create a vector of length N for an integer of N digits. x = 123045; x_vec = [1 2 3 0 4 5]; I happened upon a trick ...

circa un mese fa

Risolto


Orthogonal lines
Check whether two given lines are orthogonal or not. Two lines are orthogonal if they create a right angle at their intersect...

circa un mese fa

Carica altro