Answered
efficient way to rename files while preserving first 5 letters and removing the rest
Here is a function that will do what you need. Be very careful, though, as renaming is irreversible and you need to be certain t...

14 years ago | 2

Answered
Threshold value in singular value decomposition
See the comment above about the economical svd function. I note that the documentation for rank() says that it uses as its de...

14 years ago | 0

Answered
loop through files not working correctly.
Your code reads cycle1.xls every time it starts the loop. It needs to read each file in turn - probably like this: sch_cycl...

14 years ago | 0

| accepted

Answered
how to use indexing in array of objects?
My best so far (but maybe someone has a simpler way): c = arrayfun(@(x) x.value*k, myarray(j), 'UniformOutput', false); ...

14 years ago | 2

Answered
dicom resolution
I don't know a lot about DICOM images, but a possibility is to use dicomread imresize dicomwrite in that order.

14 years ago | 0

| accepted

Answered
How to get Canny operator Matrix (just filtering , not edge detection)?
Canny uses first derivatives of the Gaussian filter. So you can convolve with fspecial('gauss',...) and then either use the grad...

14 years ago | 2

Solved


Find the Kronecker Tensor Product without using KRON
The Kronecker Tensor Product is the result of multiplying all elements of a matrix with each of the elements of another matrix. ...

14 years ago

Answered
Negentropy?
ne = 0.5*log(2*pi*exp(1)*var(Image(:))) - entropy(Image) - though you might need to worry about the image mean. The formula...

14 years ago | 0

Answered
edge detection
You have to choose these values yourself, either on the basis of a noise model for the image and an objective function you wish ...

14 years ago | 0

Solved


Back to basics 22 - Rotate a matrix
Covering some basic topics I haven't seen elsewhere on Cody. Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...

14 years ago

Solved


Make a function that returns its own character count
Write a function that returns a 128 element vector with an accurate inventory of the ASCII characters in its own function file. ...

14 years ago

Solved


Is this group simply connected?
Given connectivity information about a graph, your job is to figure out if the graph is fully connected. You are given a list of...

14 years ago

Solved


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

14 years ago

Solved


Smallest distance between a point and a rectangle
Given two points *x* and *y* placed at opposite corners of a rectangle, find the minimal euclidean distance between another poin...

14 years ago

Answered
Gradient function of matlab
The basic operation is to take half the difference between the two values on either side of the point you are considering. For e...

14 years ago | 1

| accepted

Solved


Biggest Value in the (Neighbor)Hood
For this challenge you get two inputs: a matrix A and an integer value n. Your function should return a Matrix B of the same si...

14 years ago

Solved


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

14 years ago

Solved


count to vector
Return a matrix of numbers of dimension K by N, where K = prod(v), and N=length(v). The rows count from a vector of ones up to v...

14 years ago

Solved


Chromatic Tuner
Given a frequency, return the number of cents difference between the given frequency and its nearest semitone (in 12-tone equal ...

14 years ago

Answered
How to change values in a 2 dimensional vector at random points
This might use too much memory, but it's worth a try: c = meshgrid(1:m, 1:n); % size(x) is [n m], not [m n] change = bs...

14 years ago | 0

| accepted

Solved


magic solver
Create a function that returns _true_ and has a cody <http://www.mathworks.com/matlabcentral/cody/problems/256-return-the-size-o...

14 years ago

Solved


Distance walked 2D
Suppose you go from x-y coordinates [3,4] to [0,0] to [0,1] to [1,1], then you walked 7 units of distance.

14 years ago

Solved


Give the Shortest Path Through The Maze
*Description* The purpose of this problem is to give the shortest path through a maze. The maze will be provided in a codifie...

14 years ago

Solved


First N Perfect Squares
*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

14 years ago

Solved


Valid Chess Moves
Using <http://en.wikipedia.org/wiki/Algebraic_chess_notation standard Algebraic notation> ('' for a pawn), given previous move a...

14 years ago

Solved


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

14 years ago

Solved


Mechanics 1
I thought I would make a mechanics problem for all those physics lovers out there. Imagine two solid, rigid spheres B1 and B...

14 years ago

Solved


Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

14 years ago

Solved


Maintain shape of logical-index mask
When using logical indexing into an array, MATLAB returns a vector output. For example, if A = magic(3); mask = logi...

14 years ago

Solved


Lose control
Remove all characters that are below space in ASCII value.

14 years ago

Load more