已解决


Generate a NaN...on purpose
The goal is to create a function that will return a single "NaN" without using the nan function. I am interested to see how many...

6 years 前

已解决


Even or Odd
Write a function which can tell us if the given value x is odd or even. So if x is even return true and if x is odd return false...

6 years 前

已解决


Generate one sample of uniform random numbers between -pi and +pi
Generate one sample of uniform random numbers between -pi and +pi.

6 years 前

已解决


Create a cell array out of a struct
Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column: in: ...

6 years 前

已解决


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

6 years 前

已解决


Is my wife right? Now with even more wrong husband
Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...

6 years 前

已解决


Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

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

6 years 前

已解决


Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

6 years 前

已解决


Program an exclusive OR operation with logical operators
Program an exclusive or operation *without* using the MATLAB function xor. Use logical operators like |, &, ~, ... instead. ...

6 years 前

已解决


Transpose
Write a MATLAB script in order to convert a random length row vector (v) into a column vector.

6 years 前

已解决


Vector of numbers divisible by 3
* Input(n) - any integer * Output(v) - vector with numbers divisible by 3(exept 0) starting from n to 0 Examples: * n=6...

6 years 前

已解决


ascii value
let input='a' output=97

6 years 前

已解决


reverse string
input='rama' output='amar'

6 years 前

已解决


Who knows the last digit of pi?
There is only one man who knows the last digit of pi, who is that man? Give the name of that man, who, by popular believe, can ...

6 years 前

已解决


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

6 years 前

已解决


only input
Return the output without writing any code into the function.

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

6 years 前

已解决


Add a row of zeros on top of a matrix
Given a matrix, insert a row of zeros as the top row.

6 years 前

已解决


Divide by 4
Given the variable x as your input, divide it by 4 and put the result in y.

6 years 前

已解决


Divide by 4
Given the variable x as your input, divide it by four and put the result in y.

6 years 前

已解决


Matlab Basics - Rounding I
Write a script to round x DOWN to the next lowest integer: e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2

6 years 前

已解决


Matlab Basics II - Minimum
Write a function that returns the minimum of each ROW of a matrix x example: x = [1 2 3; 4 5 6]; output [1;4];

6 years 前

已解决


Matlab Basics - y as a function of x
Write a function to calculate y as a function of x, such that y = 6x^2 + 5x - 2

6 years 前

已解决


Finding an element in a vector
x is a vector of unknown length your function should return the index of the first element in the vector that is greater than...

6 years 前

已解决


Replace every 3rd element in a vector with 4
x is a vector of undetermined length You are to replace every 3rd element with the number 4, example: x = [11 23 34 43 2 3...

6 years 前

已解决


Matlab Basics II - Max & Index of Max
Write a function that takes a vector x, then returns both the max value in x and its location in the vector for example x ...

6 years 前

已解决


Matlab Basics II - Log and natural log
Write a function that calculates the difference between the log and natural log of a vector, to two decimal places example: ...

6 years 前

已解决


Matlab Basics - Create a row vector
Write a Matlab script to create a row vector of 10 consecutive numbers x = [1 2 3 4 5 6 7 8 9 10]

6 years 前

已解决


Matlab Basics II - squares
Write a function that takes matrix A, and squares each element in the matrix example: A = [1 2 3] output = [1 4 9]

6 years 前

加载更多