Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


Add two numbers
Add two numbers (For beginners)

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Gelöst


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

fast 3 Jahre vor

Mehr laden