Test if two numbers have the same digits
Given two integers _x1_ and _x2_, return |true| if the numbers written with no leading zeros contain the same digits. That is, t...
7ヶ月 前
解決済み
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...
7ヶ月 前
解決済み
Indirect 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...
7ヶ月 前
解決済み
Divisible by 13
Write a function to determine if a number is divisible by 13. Similar to the number seven, this can be done by a few different m...
7ヶ月 前
解決済み
Divisible by 15
Write a function to determine if a number is divisible by 15. If a number is <http://www.mathworks.com/matlabcentral/cody/proble...
7ヶ月 前
解決済み
Divisible by 12
Write a function to determine if a number is divisible by 12. Similar to the number six, this can be done by checking for divisi...
7ヶ月 前
解決済み
Divisible by 11
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...
7ヶ月 前
解決済み
Divisible by 10
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...
7ヶ月 前
解決済み
Number of Circles in a Number
Given a number, return the number of closed 'circles' in the base 10 numerical representation.
Note: the number 4 has no circ...
Getting the absolute index from a matrix
This is a basic MATLAB operation. It is for instructional purposes.
---
You may already know how to get the <http://www.ma...
Sum the squares of numbers from 1 to n
For a given value of n return the sum of square of numbers from 1 to n.
Example
For n = 2
then sum of squares = 5 (1^2 + ...
Matlab Basics II - Max & Index of Max
Write a function that takes a vector x, then returns both the max value in x and its location in the vector
for example
x ...