統計
All
Feeds
回答済み
Construct optimisation constraints vector with anonymous function.
You can also call functions within an anonymous function, e.g., param1 = 6; param2 = 0.5; nlcon = @(x)calculateconstr...
Construct optimisation constraints vector with anonymous function.
You can also call functions within an anonymous function, e.g., param1 = 6; param2 = 0.5; nlcon = @(x)calculateconstr...
9年以上 前 | 0
回答済み
How to remove the least significant bit of a signed int16
You could use |bitset()| to set the LSB to 0, but they will still be 16-bits in memory. For example: a = [56, 21, 33]; b...
How to remove the least significant bit of a signed int16
You could use |bitset()| to set the LSB to 0, but they will still be 16-bits in memory. For example: a = [56, 21, 33]; b...
9年以上 前 | 0
| 採用済み
回答済み
Why does rgb2gray use these weights for the weighted sum?
These values come from the <http://www.itu.int/rec/R-REC-BT.601-7-201103-I/en BT.601> standard for use in colour video encoding,...
Why does rgb2gray use these weights for the weighted sum?
These values come from the <http://www.itu.int/rec/R-REC-BT.601-7-201103-I/en BT.601> standard for use in colour video encoding,...
9年以上 前 | 2
回答済み
How to select and crop a particular region from the image?
If you have the Image Processing Toolbox, you can use the function <http://www.mathworks.com/help/images/ref/imrect.html |imrect...
How to select and crop a particular region from the image?
If you have the Image Processing Toolbox, you can use the function <http://www.mathworks.com/help/images/ref/imrect.html |imrect...
9年以上 前 | 0
| 採用済み
回答済み
HOW TO GET KEY PRESS INSTANCE
The key last pressed in the figure is given by its |CurrentCharacter| property, which can be obtain by: key = get(h_fig, 'C...
HOW TO GET KEY PRESS INSTANCE
The key last pressed in the figure is given by its |CurrentCharacter| property, which can be obtain by: key = get(h_fig, 'C...
9年以上 前 | 0
回答済み
Is there any way to import back figures that you initially exported from MATLAB?
Unfortunately, your figure was converted to a rasterised image when you pasted it in Microsoft Word - this process is irreversib...
Is there any way to import back figures that you initially exported from MATLAB?
Unfortunately, your figure was converted to a rasterised image when you pasted it in Microsoft Word - this process is irreversib...
9年以上 前 | 0
回答済み
How to draw orthogonal lines ?
The line between your two points can be described by y = a (x - x1) + b, where a = (y2 - y1)/(x2 - x1) b = y1, ...
How to draw orthogonal lines ?
The line between your two points can be described by y = a (x - x1) + b, where a = (y2 - y1)/(x2 - x1) b = y1, ...
9年以上 前 | 0
回答済み
For loop with changing matrix
You could use a cell array to store the ages per |j|. For example: B = cell(1, years); for j = 1:years % A is compu...
For loop with changing matrix
You could use a cell array to store the ages per |j|. For example: B = cell(1, years); for j = 1:years % A is compu...
9年以上 前 | 0
回答済み
What is the difference between double() and im2double() ?
The function double() only converts the specified array to a variable of type double, keeping the same values. The function im2d...
What is the difference between double() and im2double() ?
The function double() only converts the specified array to a variable of type double, keeping the same values. The function im2d...
9年以上 前 | 2
| 採用済み
解決済み
Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...
10年弱 前
解決済み
Length of a short side
Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...
10年弱 前
解決済み
Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....
10年弱 前
解決済み
Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...
10年弱 前
解決済み
Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product
11年以上 前
解決済み
Read a Soroban Abacus
*Description* The Soroban is the name of the modern Japanese abacus. Information on reading a Soroban can be found <http://we...
11年以上 前
解決済み
Find the largest value in the 3D matrix
Given a 3D matrix, A, find the largest value. E.g. >> A = 1:9; >> A=reshape(A,[3 1 3]); >> islargest(A) ans = 9
11年以上 前
解決済み
Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...
11年以上 前
解決済み
Back to basics 17 - white space
Covering some basic topics I haven't seen elsewhere on Cody. Remove the trailing white spaces from the input variable
11年以上 前
解決済み
Who knows the last digit of pi?
There is only one man who knows the last digit of pi, who is that man? Give the name of that man, who, by popular believe, can ...
11年以上 前
解決済み
2 b | ~ 2 b
Given a string input, output true if there are 2 b's in it, false if otherwise Examples: 'Macbeth' -> false 'Publius Cor...
11年以上 前
解決済み
Back to basics 20 - singleton dimensions
Covering some basic topics I haven't seen elsewhere on Cody. Remove the singleton dimensions from the input variable (e.g. if...
11年以上 前
解決済み
Determine Whether an array is empty
Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.
11年以上 前
解決済み
Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...
11年以上 前
解決済み
Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...
11年以上 前
解決済み
Back to basics 7 - Equal NaNs
Covering some basic topics I haven't seen elsewhere on Cody. Given 2 input variables, output true if they are equal, false ot...
11年以上 前
解決済み
Convert a vector into a number
This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...
11年以上 前
解決済み
Given a window, how many subsets of a vector sum positive
Given a vector: [1 0 -1 3 2 -3 1] and a window of 2, A sliding window would find: 1 + 0 = 1 0 - 1 = -1 ...
11年以上 前
解決済み
Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...
11年以上 前
解決済み
Get the length of a given vector
Given a vector x, the output y should equal the length of x.
11年以上 前
解決済み
Back to basics 9 - Indexed References
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix and row and column, output the index of th...
11年以上 前