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

quasi 14 anni fa | 2

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

quasi 14 anni fa | 0

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

quasi 14 anni fa | 0

| accettato

Risposto
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); ...

quasi 14 anni fa | 2

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

quasi 14 anni fa | 0

| accettato

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

quasi 14 anni fa | 2

Risolto


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

quasi 14 anni fa

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

quasi 14 anni fa | 0

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

quasi 14 anni fa | 0

Risolto


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

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

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

quasi 14 anni fa | 1

| accettato

Risolto


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

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

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

quasi 14 anni fa | 0

| accettato

Risolto


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

quasi 14 anni fa

Risolto


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.

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

Risolto


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.

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

Risolto


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

quasi 14 anni fa

Carica altro