문제를 풀었습니다


Find my secret function II
If give my function a x value it will give me a y value, so find the secret of it: Examples: input x=23 ---- >>> output y=1...

6개월 전

문제를 풀었습니다


Find my secret function I
If give my function a x value it will give me a y value, so find the secret of it: Examples: input x=[2 5 6 8 9] ---- >>> o...

6개월 전

문제를 풀었습니다


Reduce the logic
We have three logical input, x,y and z. The output is: y = ((x&y)|z)&((z|x&y)|(z&y|x))|((x&z)|z)&((y|x&z)|(z&x|y))|(x|y|z) ...

6개월 전

문제를 풀었습니다


Chicken Race
2 chickens, Pete and Fred, compete in a 100 meter race. Pete runs at a velocity of vp meter/second and Fred is slower, running ...

6개월 전

문제를 풀었습니다


Generalizing square area to triangle area
Cody Problem 61070 asked for the height, h, of a right triangle that had the same area, A, of a square with side length, c, and ...

6개월 전

문제를 풀었습니다


Compute MOSFET oxide thickness
Calculate the oxide thickness in nanometers for an NMOS on a p-type substrate. Inputs (all scalars): NA — acceptor concentrat...

6개월 전

문제를 풀었습니다


The rabbit problem
Suppose a newly-born pair of rabbits, one male, one female, are put in a field. Rabbits are able to mate at the age of one month...

6개월 전

Discussion


Using Persistent Variables to Survive Timeouts and Repeated Calls
When solving Cody problems, sometimes your solution takes too long — especially if you’re recomputing large arrays or iterative ...

6개월 전 | 0

Discussion


Tackling Complex Nonlinear Equations with fzero
The fzero function can handle extremely messy equations — even those mixing exponentials, trigonometric, and logarithmic terms —...

6개월 전 | 0

문제를 풀었습니다


Fibonacci Word
F1='0' F2='1' F3 is the catenation of the previous two. So, F3 = cat(F2,F1)='10'. similarly, F4 = cat(F3,F2)= '101' ...

6개월 전

문제를 풀었습니다


Get a Fibonacci number's index.
*N.B.* For the purpose of this exercise, the first Fibonacci number is 1, and the second is 2; that is, |fib(1) = 1| and |fib(2)...

6개월 전

문제를 풀었습니다


Number of paths on a n-dimensional grid
This problem is inspired by <https://www.mathworks.com/matlabcentral/cody/problems/1483-number-of-paths-on-a-grid> and <https:/...

6개월 전

문제를 풀었습니다


Number of paths on a 3d grid
This problem is inspired by <https://www.mathworks.com/matlabcentral/cody/problems/1483-number-of-paths-on-a-grid>, which you mi...

6개월 전

문제를 풀었습니다


Number of paths on a grid
Consider a grid formed by n vertices vertically down, and m vertices horizontally right. Your starting point is at the top lef...

6개월 전

문제를 풀었습니다


Fractal: area and perimeter of Koch snowflake
Starting from an equilateral triangle with side 's', what is the area and perimeter of Koch snowflake at n'th recursive iteratio...

6개월 전

문제를 풀었습니다


Given a number between 1-365 (a day number in a non leap year) , find what day of what month it is.
For a given number between 1-365 (a day number in a non leap year), you should check which day of which month it is. for exampl...

6개월 전

문제를 풀었습니다


Hamiltonian Cycle
This is related to the Travelling Salesman Problem 1339 created by Alex P. A Hamiltonian cycle or traceable cycle is a path tha...

6개월 전

문제를 풀었습니다


Disjunctive Normal Form
This problem is the companion to Problem <http://www.mathworks.com/matlabcentral/cody/problems/1484 1484>. In Boolean logic, a f...

6개월 전

문제를 풀었습니다


Ring Matrix
Given n (only odd), return output matrix a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. ...

6개월 전

문제를 풀었습니다


Pizza order
A pizza order by phone in diameter d1, pizza will be make only in diameter d2. Return the pizza pieces p should be make.(pizza ...

6개월 전

문제를 풀었습니다


convert 2D array of ones and zeros to checkerboard array of [1,2] where the original array was ones and zero elsewhere
Given a 2D array of ones and zeros, generate an equivalent sized checkerboard array of ones and twos. The checkerboard pattern s...

6개월 전

문제를 풀었습니다


Malus’ Law (theta) between polarizations

6개월 전

문제를 풀었습니다


Radius of an inner N-dimensional sphere
A hypercube is an N-dimensional analogue of a square (N=2). Similarly, an N-sphere is an N-dimensional analogue of a circle. Not...

6개월 전

문제를 풀었습니다


A different counting method
Given an array (x) of integers, the "counting" array (y) is showing the number of identical consecutive integers in x in front o...

6개월 전

문제를 풀었습니다


Find Sign(Zero Crossing) Changes in Array
Example; A = [1 2 3 -3 -4 -1 -24 2 4 -1 -2 3 1]; ans; [1 2 0 -3 -4 -1 0 2 0 -1 ...

6개월 전

Discussion


Nedsburg Game Hint
I set my 3D matrix up with the players in the 3rd dimension. I set up the matrix with: 1) player does not hold the card (-1), pl...

6개월 전 | 0

Discussion


Using Nested Functions and Recursion to Bypass Loop and Conditional Restrictions within Cody Problems
Some MATLAB Cody problems prohibit loops (for, while) or conditionals (if, switch, while), forcing creative solutions. One eleg...

6개월 전 | 0

Discussion


Using the On-Line Encyclopedia of Integer Sequences (OEIS) to recognize and solve tricky sequence-based problems
Many MATLAB Cody problems involve recognizing integer sequences. If a sequence looks familiar but you can’t quite place it, the...

6개월 전 | 0

Discussion


Solving MATLAB problems involving very large integers
When solving MATLAB Cody problems involving very large integers (e.g., factorials, Fibonacci numbers, or modular arithmetic), yo...

6개월 전 | 0

문제를 풀었습니다


Clueless - Lord Ned in the Game Room with the Technical Computing Language
[Warning: this is a nontrivial programming problem] Worried about the decline in reasoning skills in the clueless populace of...

6개월 전

더 보기