Solved


Basic Monte Carlo Simulation
Input is a matrix including service time and probability of service time. Another input is a random number. Function should tran...

6 days ago

Solved


The last non-zero digit of a factorial
For given positive integer n, what is the last non-zero digit of n!? Example: factorial(11) = 39916800 Last non-zero d...

6 days ago

Solved


Nth Order Polynomial Regression
Inputs: -two vectors x and y (row or column) -order of polynomial, p Outputs: -vector of coefficients [b0 b...

6 days ago

Solved


ICFP2024 006: Lambda 21 - 3D
The ICFP2024 contest was held June29 thru July 1. The contest consisted of five parts: ICFP Language, Lambdaman maze, Starship f...

6 days ago

Solved


Find the mean of a 2-D matrix after excluding elements of specified sub-matrix
You need to find the mean of a 2-D matrix after excluding elements which form an inner sub-matrix. e.g. If the input 2-D matrix ...

6 days ago

Solved


Determine ground distance from an aircraft to a DME station
In aviation, distance measuring equipment (DME) uses radio signals to determine slant distance from an aircraft to a ground stat...

6 days ago

Solved


Cumulative product of a vector
Cumulative product of a vector example x=[1 2 5 10], then answer must be [ 1 2 10 100] *If you like this prob...

6 days ago

Solved


Number of Circles in a Number
Given a number, return the number of closed 'circles' in the base 10 numerical representation. Note: the number 4 has no circ...

6 days ago

Solved


Case-insensitive Character Detection
Find the index of a particular character in a string ignoring case. Example Input: x = 'aAbhhfdf' n = 'a' ...

6 days ago

Solved


Fibonacci Sequence
Write a MATLAB function called fibonacci_sequence(n) that takes an integer n as input and returns the first n terms of the Fibon...

6 days ago

Solved


Convolution Power
Create the convolution-power vector from initial vector _x_ and power _n_. In other words, similar to the scalar case, raising ...

6 days ago

Solved


count upper and lower case characters
In a given input string, count and return the number of upper and lower case characters as u and l respectively. For example:...

6 days ago

Solved


How to permute given 3d matrix?
A(:,:,1)=[1 3] A(:,:,2)=[2 2] A(:,:,3)=[4 3] Change rows to columns and columns to rows, similar to transpose. Resul...

6 days ago

Solved


Recursion at variable input
input of any length a =2 b =2 c =3 output = (a^b)^c = 64

6 days ago

Solved


Squares of odd numbers upto a given range
Find the squares of odd numbers upto a given range. If Given x=6 return y=(1^2,3^2,5^2) y=1,9,25 If Given x=5 retu...

6 days ago

Solved


Tax Calculator
Calculate the tax for a given income. 10% tax is paid for any income up to $2,000. 20% tax is paid for additional income u...

6 days ago

Solved


Size of this cup?
The given vector has diameter of the cup in mm sampled at micrometer increments in depth from top to bottom, need output in cc a...

6 days ago

Solved


Given a Vector v1, create v2 which is the sum of each two adjacent elements in v1. {length(v2)=length(v1)-1}
if v1 is [1 2 3 4 5 6 7 8] then v2 should be [3 5 7 9 11 13 15]. if v1 is [1; 3; 5; 7] the...

6 days ago

Solved


Find the missing numbers.
Total *N* numbers are in the series of natural numbers ( *1,2,3,...,N* ). The input is an array (unsorted) of those natural num...

6 days ago

Solved


Right shift an array n times with constant space.
Right shift an array n times with constant space, that is, no extra array can be used. Right shift operation: Last element com...

6 days ago

Solved


Determine whether one vector is a subset of another
While bumbling through a pair of problems in the Number Theory group, I wrote code to determine whether a vector is a subset of ...

6 days ago

Solved


07 - Common functions and indexing 5
Create the vector _lin_: <<http://samle.dk/STTBDP/Assignment1_7e.png>> (the integers from 1 to 20) Make every other val...

11 days ago

Solved


Divisible by 10
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

11 days ago

Solved


Organic Chemistry
Determine the names of the organic component formed with carbon and hydrogen. For example, if n=1 the name is methane

11 days ago

Solved


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. ...

11 days ago

Solved


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

11 days ago

Solved


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. ...

11 days ago

Solved


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

11 days ago

Solved


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...

11 days ago

Load more