Risolto


Vertical matrix sort
Given a matrix x with n rows and m columns, return a matrix y with 2n rows and m columns, such that every column in x is sorted ...

circa 2 anni fa

Risolto


Sum the 'edge' values of a matrix
Sum the 'edge' values of an input matrix (the values along the perimeter). Example [1 2 3 4 5 6 7 8 9] Output = ...

circa 2 anni fa

Risolto


Which quadrant?
Given a complex number, output quadrant 'I' 'II' 'III' or 'IV' | II | I | ...

circa 2 anni fa

Risolto


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

circa 2 anni fa

Risolto


Positive Infinity
Round the array a towards positive infinity

circa 2 anni fa

Risolto


Area of a disk
Find the area of a disk or circle. x= radius of the disk.

circa 2 anni fa

Risolto


Find the nearest integer
Given a vector of integers and a real number find the closest integer. EX: >> a = [2 4 5 6 8 10]; >> b = 4.6; >> nea...

circa 2 anni fa

Risolto


Kinetic Energy
Given the mass m and velocity v of an object, determine its <http://en.wikipedia.org/wiki/Kinetic_energy kinetic energy>.

circa 2 anni fa

Risolto


factorial of a number x
Factorial of a number x

circa 2 anni fa

Risolto


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

circa 2 anni fa

Risolto


Summation of array
Given an array, Find the sum of all of the elements in it Examples: Input x = [1 2 3 5; 4 5 6 7]; Output y is 33

circa 2 anni fa

Risolto


Filter AC, pass DC
Input x is the sampled signal vector, may have both AC and DC components. Output vector y should not contain any AC component. ...

circa 2 anni fa

Risolto


Matrix to column conversion
Given a matrix of any size, convert it into a column vector. e.g A=[10 20 30; 40 50 60] then, B = [10; 40; ...

circa 2 anni fa

Risolto


Compare two input matrices
Check which input matrix has more elements. Return "1" if matrix A has more elements than matrix B. Otherwise return "0". Exa...

circa 2 anni fa

Risolto


Area of a Square
Given the length x of the side of a regular square, find the area of the square, A.

circa 2 anni fa

Risolto


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

circa 2 anni fa

Risolto


If-then-else
Complete the function below such that if the value of x is in the range 10 to 14, inclusive, the value 18 is assigned to y. Oth...

circa 2 anni fa

Risolto


BASICS - sum part of vector
Please make a function, where as input you get vector "x" and and vector "c", where in "c" vector you get indexes to sum. Examp...

circa 2 anni fa

Risolto


cross in array
Make a cross from "1" in odd size array. Other value from array should be equal to "0"; As input you get length of side of arra...

circa 2 anni fa

Risolto


Narcissistic problem
How many likes has this problem?

circa 2 anni fa

Risolto


angle in regular polygon
Make a function which returns measure of interior angle in x-side regular polygon. x is as input. Please pay attention, that 1 ...

circa 2 anni fa

Risolto


What's size of TV?
Many people buy TV. Usually they ask about diagonal. But also important are width and height. Let's assume that all TV have rati...

circa 2 anni fa

Risolto


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

circa 2 anni fa

Risolto


Evaluating a polynomial
Given the following polynomial and the value for x, determine y. y = 3x^5 – x^3 + 8x – 3 Example x = 1 y = 3 - 1 +...

circa 2 anni fa

Risolto


Back to basics 26 - Keywords
Covering some basic topics I haven't seen elsewhere on Cody. Return a cell array of strings of all MATLAB keywords.

circa 2 anni fa

Risolto


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

circa 2 anni fa

Risolto


Matlab Basics II - Count rows in a matrix
Write a function that returns that number of rows in a vector or matrix x example: x = [1; 2; 3] output = 3

circa 2 anni fa

Risolto


CONVERT TAN TO SIN
In a right angle triangle ABC given the tan(A) then find sin(A) For example tan(A)=3/4 then sin(A)=3/5

circa 2 anni fa

Risolto


What is the distance from point P(x,y) to the line Ax + By + C = 0?
Given a point, P(x,y), find the distance from this point to a linear line. INPUTS: x, y, A, B, C OUTPUTS: d, the distance ...

circa 2 anni fa

Risolto


Replacing a row
For matrix G=[1 2 3; 4 5 6; 7 8 9] Replace the 2nd row with 8s **remember to create matrix G

circa 2 anni fa

Carica altro