解決済み

Generate N equally spaced intervals between -L and L

Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. F...

約2ヶ月 前

解決済み

Find the largest value in the 3D matrix

Given a 3D matrix A, find the largest value. Example >> A = 1:9; >> A = reshape(A,[3 1 3]); >> islargest(A) a...

約2ヶ月 前

解決済み

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

約2ヶ月 前

解決済み

Replicate elements in vectors

Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2 3] -> [1 1 2 2 3 3] ...

約2ヶ月 前

解決済み

We love vectorized solutions. Problem 1 : remove the row average.

Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

2ヶ月 前

解決済み

Fill a zeros matrix

The aim is to fill an array of all zeros given a numerical value and the index of row and columns for this value. 3 Inputs: ...

2ヶ月 前

解決済み

Longest run of consecutive numbers

Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

2ヶ月 前

解決済み

Check if number exists in vector

Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

2ヶ月 前

解決済み

Piecewise linear interpolation

Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

2ヶ月 前