A résolu


Generate a random matrix A of (1,-1)
Input n: is an positive integer which serves as the dimension of the matrix A; Output: A=(Aij),where each entry Aij is either...

plus de 13 ans il y a

A résolu


Will there be a new leader?
Simply answer the title.

plus de 13 ans il y a

A résolu


Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter. For example: x = [1 ...

plus de 13 ans il y a

A résolu


Say something funny
Say something funny, or not. Your solution will be (fully automatically and objectively) scored based on how clever or funny ...

plus de 13 ans il y a

A résolu


Replace multiples of 5 with NaN
It is required to replace all values in a vector that are multiples of 5 with NaN. Example: input: x = [1 2 5 12 10 7] ...

plus de 13 ans il y a

A résolu


The Answer to Life, the Universe, and Everything
A variation of a previous Hitchhiker's Guide to the Galaxy problem. *Inputs:* Life, the Universe, and Everything *Output:*...

plus de 13 ans il y a

A résolu


matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below. ...

plus de 13 ans il y a

A résolu


distance between two points
compute distance between two points,where it is in Cartesian, Polar or Spherical coordinates.

plus de 13 ans il y a

A résolu


Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.

plus de 13 ans il y a

A résolu


Sort a vector
Sort a row vector without using MATLAB built_in function sort, descending or ascending as mentioned with t='de' or t='as'.

plus de 13 ans il y a

A résolu


Polynomial division
Divide a polynomial u by polynomial v and return the quotients only. Example: u = x^4+3*x^3+5*x+3 v = x^2+1 Answer: ...

plus de 13 ans il y a

A résolu


rotating a matrix
if x is the input argument,rotate it 90 degrees without using rot90 function.

plus de 13 ans il y a

A résolu


finding indices of a vector's elements
you have vector x,as input,sort it ascending by mathlab function or your own code,then in the new vector,sorted_x,for each eleme...

plus de 13 ans il y a

A résolu


Sophie Germain prime
In number theory, a prime number p is a *Sophie Germain prime* if 2p + 1 is also prime. For example, 23 is a Sophie Germain prim...

plus de 13 ans il y a

A résolu


We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

plus de 13 ans il y a

A résolu


Double Deal
*Description* Given an input vector _v_, return the first element as the first output, the second element as the second outpu...

plus de 13 ans il y a

A résolu


Create a matrix X, where each column is a shifted copy of the vector v
Example : in->v = (1:5)'; 1 2 3 4 5 out-> [1 5 4 3 2;2 1 5 4 3;3 2 1 5 4;4 3 2 1 5;5 4 3 ...

plus de 13 ans il y a

A résolu


Polybius Square
Given a string, calculate the coordinates. Input will be always in lowercase. If string is a sentence then use 0 (zero) to indic...

plus de 13 ans il y a

A résolu


Generate pi using logarithm
Generate pi using logarithm

plus de 13 ans il y a

A résolu


Calculate Alcohol By Volume with Original and Final Gravity
Given an initial gravity of un-fermented wort (OG) and a final gravity of fermented wort (FG), better known as beer, it is possi...

plus de 13 ans il y a

A résolu


Find the palindrome
Given the string a, find the longest palindromic sub-string b. So when a = 'xkayakyy'; you should return b = 'kayak';

plus de 13 ans il y a

A résolu


Simple return on investment
Assume you have some money and want to invest all your money to stock market. You randomly select a stock and invest all your mo...

plus de 13 ans il y a

A résolu


Test if two numbers have the same digits
Given two integers _x1_ and _x2_, return |true| if the numbers written with no leading zeros contain the same digits. That is, t...

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


Infernal Recursion
Consider the recursion relation: x_n = (x_(n-1)*x_(n-2))^k Given x_1, x_2, and k, x_n can be found by this definition. Wr...

plus de 13 ans il y a

A résolu


Find out missing number from a vector of 9 elements
You are given a vector of size 9, x = [x1 x2 x3 x4 x5 x6 x7 x8 x9] Elements of x may be randomly selected without repeati...

plus de 13 ans il y a

A résolu


Nilpotent matrix
Check if matrix A is <http://mathworks.com/ nilpotent>.

plus de 13 ans il y a

A résolu


Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

plus de 13 ans il y a

A résolu


Tic Tac Toe FTW
Given a tic tac toe board: * 1 represents X * 0 represents empty. * -1 represents O It is X's move. If there is an imme...

plus de 13 ans il y a

Réponse apportée
Prevent looping variable from updating in a for loop
This can be done without looping by using logical indexing: Sxx = [1 3 6 NaN 9 5 2 8 NaN 10]; Sxx = Sxx(~isnan(Sxx)); ...

plus de 13 ans il y a | 0

| A accepté

Charger plus