Gelöst


Convert matrix to 3D array of triangular matrices
Given a 2D numeric array x in which each column represents the vectorized form of an upper triangular matrix, return a 3D array ...

10 Monate vor

Gelöst


Toeplitize a matrix
Similar to <http://www.mathworks.com/matlabcentral/cody/problems/3094-hankelize-a-matrix Problem 3094. Hankelize a matrix>, now ...

10 Monate vor

Gelöst


Too Many Zeros, Dump Them!
Sometimes when I create a matrix, I use this syntax: a = zeros(1000,1000); But when the function ends, I find that I don'...

10 Monate vor

Gelöst


Enlarge array
Given an m-by-n numeric array (A) and a 1-by-2 vector (sz) indicating the dimensions [p q] to enlarge each element, return an (m...

10 Monate vor

Gelöst


Must be in the front row...
You are given a matrix followed by a single number. Your object is to write a script that will shift the matrix around so that ...

10 Monate vor

Gelöst


subtract central cross
Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

10 Monate vor

Gelöst


Replace Nonzero Numbers with 1
Given the matrix x, return the matrix y with non zero elements replaced with 1. Example: Input x = [ 1 2 0 0 0 ...

10 Monate vor

Gelöst


Write a function man that takes a row vector v and returns a matrix H as follows..
Write a function called man that takes a row vector v as an input and returns a matrix H whose first column consist of the eleme...

10 Monate vor

Gelöst


frame of the matrix
Given the matrix M, return M without the external frame.

10 Monate vor

Gelöst


Go to the head of the class!
You're given a matrix and a single number. If that number is in the matrix, reorder the matrix so that number is in the first r...

10 Monate vor

Gelöst


A Binary Search
One way to locate a target value in a sorted array, is to use a binary search algorithm. Here, you test if the midpoint in the a...

10 Monate vor

Gelöst


A matrix of extroverts
Now that the introverts have had their script, the extroverts spoke up (naturally!) and demanded one as well. You will be given...

10 Monate vor

Gelöst


Matrix multiplication across rows
Given matrix m, return matrix n such that, rows of n are result of multiplication of the rows of the input matrix Example ...

10 Monate vor

Gelöst


Given a matrix, swap the 2nd & 3rd columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

10 Monate vor

Gelöst


Interpolated Value Between Two Points
Given two points, and , a new location x, and a method "linear" or "cubic", return the value of a linear or cubic interpolant t...

10 Monate vor

Gelöst


Taylor Series
You can use a Taylor series to approximate common functions. The Taylor series for sin(x) is Using only the first several te...

10 Monate vor

Gelöst


Calculate Angle From Axis
Given coordinates x and y, an axis ("X" or "Y"), and a direction ("cw" or "ccw", meaning clockwise and counterclockwise, respect...

10 Monate vor

Gelöst


Generate Pascal's Triangle Matrix
Pascal's triangle is an arrangement of numbers where each value is the sum of the values adjacent to it in the previous row: ...

10 Monate vor

Gelöst


Estimating Euler's (Oi-ler-z) Number
Euler's number is an irrational constant given by Starting with x=0, count the number of times you can add a uniformly distrib...

10 Monate vor

Gelöst


Next Tribonacci Number
The "Tribonacci" sequence is an extension of the idea of the Fibonacci sequence: That is, each new term is the sum of the thr...

10 Monate vor

Gelöst


Where the Four Corners Am I? (Vectorized)
NOTE: this problem is intended to build on problem #55960 ("Where the Four Corners Am I?"). You may wish to solve that problem f...

10 Monate vor

Gelöst


Easy Sequences 12: 50th Prime
Write a function that outputs the th prime after a given number . For example, the th prime after is . NOTE: If itself is pr...

10 Monate vor

Gelöst


Generate Tribonacci Sequence
The "Tribonacci" sequence is an extension of the idea of the Fibonacci sequence: That is, each new term is the sum of the thr...

10 Monate vor

Gelöst


function on a moving window
Create a function that applies an operation (such as @sum, @mean, @std, @norm etc) to a moving window of the data. First exampl...

10 Monate vor

Gelöst


Create a function handle that reverses the input arguments of another function handle
Given a function that takes two input arguments and returns one output, create another function handle that performs the same op...

10 Monate vor

Gelöst


Apply a function array to an array of numbers
It is required to apply a cell array of functions to a numerical array, where the functions accept only scalar inputs. Exampl...

10 Monate vor

Gelöst


Function composition
Write a function that accepts two function handles f and g and returns the composition h. That is, h = (f o g)(x) = f(g(x)) ...

10 Monate vor

Gelöst


Define the operators of function_handles
Suppose f and g are function_handles, try to define f+g,f-g,f*g and f/g. e.g. if f = @(x)x and g = @(x)x+1 ...

10 Monate vor

Gelöst


String Logic 18
Examples: 'DIG' --> 'DG' 'IMPORTANT' --> 'IPRAT' 'DEAL' --> 'DA' 'LIMB' --> 'LM' 'MOSTLY' --> 'MSL'

10 Monate vor

Gelöst


Calculate Lift Force on an Airfoil
Write a MATLAB function to calculate the lift force acting on an airfoil given the air density, wing area, velocity of the airfl...

10 Monate vor

Mehr laden