統計
All
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年 前
解決済み
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年 前
解決済み
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年弱 前
解決済み
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年弱 前
解決済み
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年 前
解決済み
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年 前
解決済み
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年 前
解決済み
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年 前
解決済み
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年 前
解決済み
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年 前
解決済み
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年 前
解決済み
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年 前
解決済み
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年以上 前
解決済み
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年以上 前
解決済み
Mysterious digits operation (easy)
What is this digit operation? 0 -> 0 1 -> 9 121 -> 9 44 -> 6 15 -> 5 1243 -> 7 ...
2年以上 前
解決済み
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年以上 前
解決済み
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年以上 前
解決済み
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年以上 前
解決済み
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年以上 前
解決済み
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年以上 前
回答済み
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年弱 前 | 0

