Gelöst


Solve t^(a*x^2+b*x+c)=s
Solve t^(a*x^2+b*x+c)=s. Return x vector as result. Example a=1, b=2, c=1, t=3, s=15. Result x(1)= 0.5700 x(2)=-2.5700 H...

mehr als 5 Jahre vor

Gelöst


Vertically stack two vectors
Stack two vectors on top of each-other so that... if A = [1 5 3] and B = [8 6 4] then C = [1 5 3 ; 8 6 4]

mehr als 5 Jahre vor

Gelöst


Pass the Threshold!!
Write a Matlab function that will take as input a matrix of arbitrary dimensions and a scalar threshold value, and return a vec...

mehr als 5 Jahre vor

Gelöst


Volume of this donut
Given hole diameter a, and outermost diameter b, determine the volume y of the resulting donut.

mehr als 5 Jahre vor

Gelöst


Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

mehr als 5 Jahre vor

Gelöst


Angle between two vectors
Given 2 pairs of _cartesian co-ordinates_, determine the angle between the 2 vectors formed by the _points_ and the _origin_. An...

mehr als 5 Jahre vor

Gelöst


calculate PI without using pi function
There are many methods to get the pi(Ratio of circumference to diameter). You should get pi without using the pi function in M...

mehr als 5 Jahre vor

Gelöst


Calculate the number of elements in a matrix.
Calculate the number of elements in a matrix.

mehr als 5 Jahre vor

Gelöst


For a rectangle, if x is the length and 2x is width. Then find out x from the area of the rectangle?
For a rectangle, if x is the length and 2x is the width. Then find out x from the area of the rectangle? if the area is equal...

mehr als 5 Jahre vor

Gelöst


Natural numbers in string form
Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

mehr als 5 Jahre vor

Gelöst


Split a string into chunks of specified length
Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...

mehr als 5 Jahre vor

Gelöst


Related Vectors
I have two vectors A & B. If the values in vector A is zero then the corresponding value in vector B should be zero. Example:...

mehr als 5 Jahre vor

Gelöst


Moving average (variable kernel length)
Find the moving average in a vector. The kernel length is a variable. For example x = 1:10 kernel_length = 2 would r...

mehr als 5 Jahre vor

Gelöst


Sort complex numbers into complex conjugate pairs
Sort complex numbers into complex conjugate pairs. Example: Input x = [3-6i -1-4i -1+4i 3+6i] Sorted output = [-1 - ...

mehr als 5 Jahre vor

Gelöst


Find the complement of a number in binary
Input x is a decimal number and output y is the complement of binary representation of x. For example, x = 10 has the binary ...

mehr als 5 Jahre vor

Gelöst


Find argmax of a function
You are given vectors x and y (=f(x)). Return the element of x for which f(x) is maximized.

mehr als 5 Jahre vor

Gelöst


Probability of Choosing a Red Ball
Given two jars of red and blue balls, find the probability of choosing a red ball from Jar 1 after going through the steps. ...

mehr als 5 Jahre vor

Gelöst


Change on Spiral Matrix
n>=3, generate a matrix of nth such that n^2 is the max number, and max number must be in [1,1] or [end, end]. One example will ...

mehr als 5 Jahre vor

Gelöst


Largest Geometric Series
Extension of Ned Gulley's wonderful <http://www.mathworks.com/matlabcentral/cody/problems/317 Problem 317>. In a geometric se...

mehr als 5 Jahre vor

Gelöst


Combinations without using nchoosek
You have to generate a matrix with all possible combinations of n elements *taken 2* at a time, *without using nchoosek(1:n,2)* ...

mehr als 5 Jahre vor

Gelöst


microseconds passed today
Calculate the amount of microseconds passed for a given date string. Return the value, rounded to the nearest integer, as a stri...

mehr als 5 Jahre vor

Gelöst


Sum! Sum! Sum!
Calculate the sum of the sequence up to nth term >> a,aa,aaa,aaaa,... 2,22,222,2222,... [for a=2]

mehr als 5 Jahre vor

Gelöst


Basics - not so easy division
Please make a function whcih divides x/y, but pay attention for some exceptions with NaN,0,Inf. Sometimes return "ERROR" instead...

mehr als 5 Jahre vor

Gelöst


Scalar Matrix Manipulation
Assume, input x is a scalar matrix such as, x = 2 0 0 0 2 0 0 0 2 th...

mehr als 5 Jahre vor

Gelöst


cross in array
Make a cross from "1" in odd size array. Other value from array should be equal to "0"; As input you get length of side of arra...

mehr als 5 Jahre vor

Gelöst


Basic commands - Least common multiple
Make a function which will return least common multiple of "a" and "b" Example: a=8; b=6; y=24;

mehr als 5 Jahre vor

Gelöst


Reverse the Words (not letters) of a String
*Description* Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...

mehr als 5 Jahre vor

Gelöst


Find the sum

mehr als 5 Jahre vor

Gelöst


Check prime numbers
Let x, return 1 if x is a prime number, 0 otherwise e.g x = 7, return y =1; x = 6 return y = 0;

mehr als 5 Jahre vor

Gelöst


Square
square root of x

mehr als 5 Jahre vor

Mehr laden