解決済み


Switch matrix to a column vector
for e.g. x = [1 2 3 4] y = 1 3 2 4

3年弱 前

解決済み


Back to basics 19 - character types
Covering some basic topics I haven't seen elsewhere on Cody. Return the number of punctuation characters in the input variabl...

3年弱 前

解決済み


Count ones
Write a program to count number of ones (1s) in an integer variable input. For example: Input x=2200112231 output y=3 I...

3年弱 前

解決済み


Area of a Square
Inside a square is a circle with radius r. What is the area of the square?

3年弱 前

解決済み


Who invented zero?
We know the importance zero in computer science, mathematics... but who invented zero? Clue: He was the first in the line ...

3年弱 前

解決済み


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

3年弱 前

解決済み


How many days in a month?
Return the number of days in a given month in 2017. If the input is not a valid month number, return -1. Examples: Input...

3年弱 前

解決済み


Add two numbers
Add two numbers (For beginners)

3年弱 前

解決済み


Squaring Matrix
Square the following matrix using matlab % A = 1 2 3 4 5 6 7 8 So new matrix should display...

3年弱 前

解決済み


Find out sum of all elements of given Matrix
Find out sum of all elements of given Matrix A=[1 2 3;4 5 6 ;7 8 9]; Answer must be: 45 *If you like this problem, pl...

3年弱 前

解決済み


Write a code that will follow the equation y = x * (x + x) * x.
If x = 5, y = 5 * (5+5) * 5 = 250

3年弱 前

解決済み


How many Integers?
Count the integers in a given vector |v|. You *must* use a loop to count each element separately. Examples: Input: v...

3年弱 前

解決済み


Complex number
For complex number c=a+bi, write code that will add a and b together.

3年弱 前

解決済み


Negative matrix
Change the sign of all elements in given matrix.

3年弱 前

解決済み


Square Diagonal
If n is the given number, then make a diagonal matrix of size 2*2 with the square of that number.

3年弱 前

解決済み


03 - Matrix Variables 2
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3b.png>> A 9x9 matrix of zeros, but with the following v...

3年弱 前

解決済み


Mode
Find the mode of the vector Assumption: no vector is bimodal Example 1: input=[1 2 3 4 4]; output=4 Example 2: input=[7...

3年弱 前

解決済み


It dseon't mettar waht oedrr the lrettes in a wrod are.
An internet meme from 2003 (read more <http://www.snopes.com/language/apocryph/cambridge.asp here>) asserted that readers are re...

3年弱 前

解決済み


Half?
If you toss an even number (x) of coins, what is the probability (y) of 50% head and 50% tail?

3年弱 前

解決済み


07 - Common functions and indexing 3
Define _eMat_: <<http://samle.dk/STTBDP/Assignment1_3e.png>> Create the variable _eMat2_, which is equal to _eMat_ with th...

3年弱 前

解決済み


Counting down
Create a vector that counts from 450 to 200 in increments of 10.

3年弱 前

解決済み


Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime nu...

3年弱 前

解決済み


02 - Vector Variables 2
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2b.png>>

3年弱 前

解決済み


Sum the numbers on the main diagonal
Sum the numbers on the main diagonal of an n-by-n matrix. For input: A = [1 2 4 3 6 2 2 4 7]...

3年弱 前

解決済み


"mirror" matrix
Create n x 2n "mirror" matrix of this type: Examples For n = 2 m = [ 1 2 2 1 1 2 2 1 ] For n = 3 m = ...

3年弱 前

解決済み


Square root of a number
Write a code that will output the square root of x.

3年弱 前

解決済み


Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros. Exam...

3年弱 前

解決済み


Sum the Digits of a Number
Given an integer, sum the digits repeatedly until you end up with a single value less than 10. For example, if you add the di...

3年弱 前

解決済み


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

3年弱 前

解決済み


Sum of series II
What is the sum of the following sequence: Σ(2k-1)^2 for k=1...n for different n?

3年弱 前

さらに読み込む