解決済み


Inner product of two vectors
Find the inner product of two vectors.

12ヶ月 前

解決済み


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

12ヶ月 前

解決済み


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

12ヶ月 前

解決済み


Finding peaks
Find the peak values in the signal. The peak value is defined as the local maxima. For example, x= [1 12 3 2 7 0 3 1 19 7]; ...

12ヶ月 前

解決済み


Reindex a vector
You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

12ヶ月 前

解決済み


Calculate Amount of Cake Frosting
Given two input variables r and h, which stand for the radius and height of a cake, calculate the surface area of the cake you n...

12ヶ月 前

解決済み


Rescale Scores
Each column (except last) of matrix X contains students' scores in a course assignment or a test. The last column has a weighted...

12ヶ月 前

解決済み


Linear Motion 7
A robot has a maximum rate of acceleration of a m/s2. If the robot starts from rest and reaches a velocity of v2 m/s. How far ha...

12ヶ月 前

解決済み


Create a vector whose elements depend on the previous element
The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

12ヶ月 前

解決済み


Create an n-by-n null matrix and fill with ones certain positions
The positions will be indicated by a z-by-2 matrix. Each row in this z-by-2 matrix will have the row and column in which a 1 has...

12ヶ月 前

解決済み


Unique values without using UNIQUE function
You must return unique values in a vector in *stable* mode without using the unique function. About stable order flag: ...

12ヶ月 前

解決済み


Create an index-powered vector
Given a input vector x, return y as index-powered vector as shown below. Example x = [2 3 6 9] then y should be [...

12ヶ月 前

解決済み


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2 3 3 3 4...

12ヶ月 前

解決済み


Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists. x = [2 6 4 9 -10 3 1 5 -10]; So ...

約1年 前

解決済み


Find last zero for each column
Given a numeric array of arbitrary size, return the row index of the last zero for each column. If a column contains all nonzero...

約1年 前

解決済み


Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
For a row vector: V=[7 1 2 -3] there is one sign change (from 2 to -3). So, the function you write must return N=1. F...

約1年 前

解決済み


Symmetry of vector
Determine whether the vector is symmetric or not (vector could be even or odd in length). For example: x = [1 2 3 3 2 1] is s...

約1年 前

解決済み


Matrix indexing with two vectors of indices
Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

約1年 前

解決済み


Getting logical indexes
This is a basic MATLAB operation. It is for instructional purposes. --- Logical indexing works like this. thresh = 4...

約1年 前

解決済み


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

約1年 前

質問


How to save the result of each loop separately
I want to create two variables which are matrices is zeros(3,2) and zeros(4,2) y = [3 4]; for i=1:length(y) x=zeros(y(i)...

約1年 前 | 3 件の回答 | 0

3

回答

解決済み


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

約1年 前

解決済み


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

約1年 前

質問


How do I form a matrix from an array of rows and columns
A=ones(10) a=[1 3 5 6 9] b=[1 2 4 7 9] A(a,b)=0 should provide A(1,1)=0 A(3,2)=0 A(5,4)=0 A(6,7)=0 A(9,9)=0

約1年 前 | 2 件の回答 | 0

2

回答

解決済み


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

約1年 前

解決済み


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

約1年 前

解決済み


Getting the indices from a matrix
Inspired by Problem 645. Getting the indices from a matrix. Given a matrix A (or a vector), return the indices (always in row...

約1年 前

解決済み


First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero i...

約1年 前

解決済み


Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The values of B are in the same order a...

約1年 前

解決済み


intersection of matrices
Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identic...

約1年 前

さらに読み込む