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 ...
約9年 前
解決済み
Sorting
Assume that x is an n-by-2 matrix. The aim is to return the first column of x, but sorted according to the second column.
Exa...
約9年 前
解決済み
Wind Chill Computation
On a windy day, a temperature of 15 degrees may feel colder, perhaps 7 degrees. The formula below calculates the "wind chill," i...
Replace multiples of 5 with NaN
It is required to replace all values in a vector that are multiples of 5 with NaN.
Example:
input: x = [1 2 5 12 10 7]
...
約9年 前
解決済み
Remainder
Make 'y' equal to the remainder of 27 divided by 5.
When x=27 and t=5
約9年 前
解決済み
sum of non-primes
The sum of the non-primes below 10 is 1+4+6+8+9+10=38
Find the sum of all the non-primes below the input, N.
約9年 前
解決済み
Do you like your boss?
Do you like your boss?
Answer can be any string!
For example:
Boss = 'Do you like your boss?';
Output = 'yes'
or
...
約9年 前
質問
mldivide algorithm for sparse matrices
In the documentation of the _mldivide_ function, two flow charts report the steps used by MATLAB to decide which method to apply...
約9年 前 | 1 件の回答 | 0
1
回答
解決済み
Space Saver
Remove all characters that are below a space in ASCII value.
約9年 前
解決済み
sum of first 'n' terms
Given n=10, find the sum of first 'n' terms
Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these n=10 terms is 55...
約9年 前
解決済み
Count ones
Write a program to count number of ones (1s) in an integer variable input.
For example:
Input x=2200112231
output y=3
I...
約9年 前
解決済み
Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.
Generate a random matrix A of (1,-1)
Input n: is an positive integer which serves as the dimension of the matrix A;
Output: A=(Aij),where each entry Aij is either...