解決済み


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

7年以上 前

解決済み


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

7年以上 前

解決済み


"Low : High - Low : High - Turn around " -- Create a subindices vector
Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

7年以上 前

解決済み


create a square matrix
create a [n*n] matrix. example: mat(4)= [ 1 4 9 16 4 4 9 16 9 9 ...

7年以上 前

解決済み


Create a square matrix with given conditions
Create a square matrix, M, which should be populated as follows: M = [ n^2 n * (n-1) n * (n-2) ... n * 2 n * ...

7年以上 前

解決済み


Produce the following matrix
Produce the following matrix x = [2 3 4] y_correct = [1 1/2 1/3; 2 1 1/4; 3 4 1];

7年以上 前

解決済み


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

7年以上 前

解決済み


Make a diamond
Given n, odd number > 1, return n by n matrix consist of "null" and "*" characters arranged like a diamond. No toolbox funct...

7年以上 前

解決済み


Form a square matrix from four square sub-matrices
Create a square matrix, y, from 4 square sub-matrices that will be constructed (x1, x2, x3, x4): y = [x1 x2; x3 x4]; ...

7年以上 前

解決済み


Make a rainbow matrix (follow-up to checkerboard matrix)
Given an integer n, make an n-by-n matrix as shown below. The a(1,1) should be 0. As we move away from the top-left, the number ...

7年以上 前

解決済み


Sum of unique multiples of 3 and 5
If we list all the natural numbers up to 15 that are multiples of 3 or 5, we get 3, 5, 6, 9, 10, 12 and 15. The sum of these mul...

7年以上 前

解決済み


Clockwise or Counterclockwise
Given a list of 2-d points defining the vertices of a polygon, determine whether these points are sorted clockwise. The input...

7年以上 前

解決済み


What score did they give?
Your task in this problem is to figure out the most recent score, |S|, submitted. <<https://upload.wikimedia.org/wikipedia/...

7年以上 前

解決済み


Check if a matrix is a palindrome in all directions
Check if a matrix is a palindrome both vertically and horizontally. You function will return *true* for |[1,2,1]| or |[2,7,2;...

7年以上 前

解決済み


Is input the global variable z?
When the input is certainly not the global variable |z|, your function must return |false|. Otherwise return |true|. All input...

7年以上 前

解決済み


Integer sequence - 2 : Kolakoski sequence
Get the n-th term of <https://oeis.org/A000002 Kolakoski Sequence>.

7年以上 前

解決済み


Monte Carlo integration: area of a polygon
The area of a polygon (or any plane shape) can be evaluated by <https://www.mathworks.com/matlabcentral/cody/problems/179 Monte ...

7年以上 前

解決済み


Comparison of floating-point numbers (singles)
<https://au.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html Floating-point numbers> cannot generally be repres...

7年以上 前

解決済み


Comparison of floating-point numbers (doubles)
<https://au.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html Floating-point numbers> cannot generally be repres...

7年以上 前

解決済み


Numbers on 7-segment
This is a 7-segment: _ |_| |_| It's a 3-by-3 char matrix.It has made by 3 characters: '_' , '|' and ' ' (space...

7年以上 前

解決済み


Kurosu Solver
This problem is related to <https://www.mathworks.com/matlabcentral/cody/problems/44657-kurosu-checker Problem 44657>. The ga...

8年弱 前

解決済み


find number of times of occurrence of the most frequent number in a row vector
In a given row vector, find the number of times a mode of a row vector has occurred example: in [2 5 5 5 5 3], output is 4 ...

8年弱 前

解決済み


Kurosu Checker
The game of Kurosu is simple. A square grid contains cells that can be filled with either a 'X' or an 'O', similarly to a tic-ta...

8年弱 前

解決済み


Basics: counting digits of a number irrespective of the sign
publish the number of digits in any input integer example: -23---->2

8年弱 前

解決済み


Draw a 'X'!
Given n as input Draw a 'X' in a n-by-n matrix. example: n=3 y=[1 0 1 0 1 0 1 0 1] n=4 y=[1 0 0...

8年弱 前

解決済み


N-Dimensional Array Slice
Given an N-dimensional array, _A_, an index, _I_, and a dimension, _d_, return the _I_ th elements of _A_ in the _d_ dimension. ...

8年弱 前

解決済み


Outlier number!
Find a number which has maximum distance from the mean value of vector A. Example: A=[5 2 1 5 6 2 5 9] y=9

8年弱 前

解決済み


Prime numbers between a , b.
Find all prime number between a & b (including a and b). example: a=100 b=120 y= [101 103 107 109 113]

8年弱 前

解決済み


Win all the time!
This is a 2-players game. One of them is your algorithm. Your algorithm must win in all games. In this game there are 3 rows...

8年弱 前

解決済み


Draw a 'Z'.
Given _n_ as input, generate a n-by-n matrix like 'Z' by _0_ and _1_ . Example: n=5 ans= [1 1 1 1 1 0 0 0 1 ...

8年弱 前

さらに読み込む