統計
All
Feeds
質問
Does MATLAB plotting accept matplotlib syntax now?
One of my students turned in some code and it threw a bunch of errors on my 2019b installation. When I was going through it the...
4年以上 前 | 1 件の回答 | 0
1
回答解決済み
Get the length of a given vector
Given a vector x, the output y should equal the length of x.
4年以上 前
解決済み
Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...
4年以上 前
解決済み
Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.
5年以上 前
解決済み
The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".
9年弱 前
解決済み
intersection of matrices
Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identi...
9年弱 前
解決済み
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...
9年弱 前
解決済み
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...
9年弱 前
解決済み
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...
9年弱 前
解決済み
Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....
9年弱 前
解決済み
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...
9年弱 前
解決済み
Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...
約9年 前
解決済み
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 s...
約9年 前
解決済み
Getting logical indexes
This is a basic MATLAB operation. It is for instructional purposes. --- Logical indexing works like this. thresh = 4...
約9年 前
解決済み
Return elements unique to either input
Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...
約9年 前
解決済み
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...
約9年 前
解決済み
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] n=0...
約9年 前
解決済み
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...
約9年 前
解決済み
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,...
約9年 前
解決済み
Produce a cosine wave
Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/cosine-eqn.png>>
約9年 前
解決済み
Connect blocks in a model
Connect the blocks in the model to produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/connect-blocks...
約9年 前
解決済み
Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...
約9年 前
解決済み
Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.
約9年 前
解決済み
Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...
約9年 前
解決済み
Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...
約9年 前
解決済み
Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...
約9年 前
解決済み
Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...
約9年 前
解決済み
Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...
約9年 前
解決済み
Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...
約9年 前
解決済み
Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...
約9年 前

