Feeds
已解决
matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...
1 year 前
已解决
MatCAT - Reconstruct X from Its X-rays
Consider a matrix x x = [ 1 2 0 0 5 0 3 0 8 ] If we sum x along the rows we get row_sums = [3 5 11] ...
1 year 前
已解决
Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime numb...
2 years 前
已解决
Snow Accumulation and Structural Risks To Residential Properties
The density of snow depends on the amount of liquid water it contains: Dry Snow is about 50 kg/m^3 Wet Snow is about 200 kg/m^...
2 years 前
已解决
First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero i...
2 years 前
已解决
Get the area codes from a list of phone numbers
Given a string of text with phone numbers in it, return a unique'd cell array of strings that are the area codes. s = '508-647...
2 years 前
已解决
Sum of odd numbers in a matrix
Find the sum of all the odd numbers in a matrix. Example x = [2 3 5 7 1 4 11] y = 27
2 years 前
已解决
Too Many Zeros, Dump Them!
Sometimes when I create a matrix, I use this syntax: a = zeros(1000,1000); But when the function ends, I find that I don'...
2 years 前
已解决
Draw 'H'
Draw a x-by-x matrix 'H' using 1 and 0. (x is odd and bigger than 2) Example: x=5 ans= [1 0 0 0 1 1 0 0 0 1 ...
2 years 前
已解决
Is the Point in a Triangle?
Check whether a point or multiple points is/are in a triangle with three corners Points = [x, y]; Triangle = [x1, y1; x...
2 years 前
已解决
Draw 'B'
Draw a x-by-x matrix 'B' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 0 1 0 0 0 1 ...
2 years 前
已解决
Project Euler: Problem 3, Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number being input, input might be ui...
2 years 前
已解决
Convert to Binary Coded Decimal
Convert from decimal representation to <http://en.wikipedia.org/wiki/Binary-coded_decimal Binary Code Decimal> (or BCD) represen...
2 years 前
已解决
Bit calculation
Give me the count of numbers from 1 to n having their last two bits as 0. For example function y = ret_count(4) y = x...
2 years 前
已解决
Mysterious digits operation (easy)
What is this digit operation? 0 -> 0 1 -> 9 121 -> 9 44 -> 6 15 -> 5 1243 -> 7 ...
2 years 前
已解决
Evened up (or not)
You will be provided with an array or matrix that contains various numbers, in addition to an evening variable, e, set to 1 or 0...
2 years 前
已解决
De-primed
Write a function that will multiply every prime number in the array or matrix by two, leaving all other numbers the same, and re...
2 years 前
已解决
With apologies to William Blake
Coder Coder, typing fast Sitting at your desk, aghast. What immortal MATLAB script will solve this problem, nice and qu...
2 years 前
已解决
Generate this matrix
For a given odd integer n, generate a matrix as follows: Input: n = 5; Output: [ 2 1 0 0 0 1 ...
2 years 前
已解决
Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...
2 years 前
已回答
Problem with answer in my code
Would be easier to do something along these lines: This will give you the matrix that you can then strip into indvidual rows if...
Problem with answer in my code
Would be easier to do something along these lines: This will give you the matrix that you can then strip into indvidual rows if...
3 years 前 | 0

