已解决


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

11 years 前

已解决


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

11 years 前

已解决


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

11 years 前

已解决


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

11 years 前

已解决


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

11 years 前

已解决


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

11 years 前

已解决


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

11 years 前

已解决


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

11 years 前

已解决


Find indices of multiple minima in a vector
I have a vector, say: x= [ 1 5 6 2 6 1 3 5 1] Now I would like to get the index of the minimum values in this vector. When...

11 years 前

已解决


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

11 years 前

已解决


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

11 years 前

已解决


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

11 years 前

已解决


give nth decimal place of pi
max 15th place after the decimal point is ok for now

11 years 前

已解决


All capital?
Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

11 years 前

已解决


Test for balanced parentheses
Given the input inStr, give the boolean output out indicating whether all the parentheses are balanced. Examples: * If ...

11 years 前

已解决


Maximum running product for a string of numbers
Given a string s representing a list of numbers, find the five consecutive numbers that multiply to form the largest number. Spe...

11 years 前

已解决


Pascal's Triangle
Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

11 years 前

已解决


Sum the elements in either diagonal of a square matrix
Sum the elements of a square matrix that lie on either the major diagonal or anti-diagonal.

11 years 前

已解决


Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
If _p_ is the perimeter of a right angle triangle with integral length sides, { _a_, _b_, _c_ }, there are exactly three solutio...

11 years 前

已解决


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

11 years 前

已解决


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

11 years 前

已解决


Create a patchwork matrix
This function will assemble a large matrix out of a number of smaller ones m1, m2, etc., according to a pattern P. If P is 3x5,...

11 years 前

已解决


Matrix indexing with two vectors of indices
Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

11 years 前

已解决


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

11 years 前

已解决


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

11 years 前

已解决


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

11 years 前

已解决


Rotate a Matrix
Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise

11 years 前

已解决


Getting logical indexes
This is a basic MATLAB operation. It is for instructional purposes. --- Logical indexing works like this. thresh = 4...

11 years 前

已解决


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

11 years 前

已解决


Reindex a vector
You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

11 years 前

加载更多