Discussion


Why doesn't Cody accept a class definition?
I created a solution for <http://www.mathworks.com/matlabcentral/cody/problems/1745-get-me Cody Problem 1745 (Get me!)> that is ...

más de 11 años hace | 0

Resuelto


Path of least resistance
Find the length of the shortest path through the matrix from the top left to bottom right corner. You may move right, down, or d...

más de 11 años hace

Respondida
Running multiple for loops
In the second and third loops, the starting value is higher than the end. Maybe you want for ii=3:-0.001:.967108 (this c...

más de 11 años hace | 0

Resuelto


Elapsed time is -0.005204 seconds.
Write a function that takes less than zero seconds to execute, as measured using tic and toc. For repeatability, the test case p...

más de 11 años hace

Resuelto


Slicing the cube
A bored matlab enthusiast has a cube with volume n^3. He decides to paint the entire surface of the cube red. Then, with slices...

más de 11 años hace

Resuelto


Narcissistic problem
How many likes has this problem?

más de 11 años hace

Respondida
Finding coordinates for matrix from another matrix
I will assume that you want four-dimensional coordinates and that you want all the matches for each value. I suggest replacing ...

más de 11 años hace | 0

Respondida
Assign to cell elements with both string and number?
You can use <http://www.mathworks.com/help/matlab/ref/num2str.html num2str> to convert |x| to string; but you need to make it op...

más de 11 años hace | 0

| aceptada

Respondida
Parse error: usage might be invalid MATLAB syntax
You included the answers in the file, and MATLAB is trying to interpret them as commands. My guess is that you don't need the di...

más de 11 años hace | 1

| aceptada

Resuelto


03 - Matrix Variables 1
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3a.png>> A 9x9 matrix full of 2's (Hint: use *ones* o...

más de 11 años hace

Resuelto


Solving Quadratic Equations (Version 1)
Quadratic equations have the form: ax^2 + bx + c = 0. Example: x^2 + 3x + 2 = 0, where a = 1, b = 3, and c = 2. The equation has...

más de 11 años hace

Pregunta


File names with spaces used as command line arguments
I am trying to run an external program with command line arguments. The syntax is like this: bertini <inputFile> <startpoin...

más de 11 años hace | 4 respuestas | 2

4

respuestas

Respondida
How to use if statement to test if it is a integer and real number?
An integer is also a real number, so you only need one test. Also, if you want to delete numbers that are not real, you need to ...

casi 12 años hace | 0

Respondida
Basic differential solving and plotting problem for a part of an exam.
When you add some scalars to a vector, you get a vector, so [v*(1-v)*(v-alpha)-w+C; varepsilon*(v-gamma*w)] stacks 2-vec...

casi 12 años hace | 1

Respondida
Anything to use instead of TwoD
It looks like <http://www.mathworks.com/help/matlab/ref/integral2.html integral2> might fit your needs, although it doesn't have...

casi 12 años hace | 0

Respondida
simulating an unbias coin with a bias coin flip
I think that the simplest approach is to write a little function to simulate a single toss, and then build up your simulation fr...

casi 12 años hace | 0

| aceptada

Resuelto


System of equations
Find a solution to a system of equations represented by a |n| by |n+1| matrix. For instance, [ 2 0 4; => 2*x = 4 ...

casi 12 años hace

Resuelto


Twins in a Window
<http://en.wikipedia.org/wiki/Twin_primes Twin primes> are prime numbers that differ by 2, such as [11,13] or [41,43]. Write a f...

casi 12 años hace

Resuelto


Volume and area of a sphere
Input(r) - radius Output([v,s]) - volume and area

casi 12 años hace

Resuelto


Back to basics 2 - Function Path
Covering some basic topics I haven't seen elsewhere on Cody. Given a string that is the name of a MATLAB function, return a s...

casi 12 años hace

Resuelto


Create a vector whose elements depend on the previous element
The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

casi 12 años hace

Resuelto


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

casi 12 años hace

Resuelto


Basics: 'Find the eigenvalues of given matrix
Find the eigenvalues y for a given matrix x.

casi 12 años hace

Resuelto


Celcius to Kelvin
Convert Celsius degrees to Kelvin temperature.

casi 12 años hace

Resuelto


What's Your BMI?
Find the body mass index. For reference, please refer to Wikipedia here: <http://en.wikipedia.org/wiki/Body_mass_index body ...

casi 12 años hace

Resuelto


Getting the row and column location from a matrix
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to get <http://www.mathwo...

casi 12 años hace

Resuelto


Back to basics 16 - byte order
Covering some basic topics I haven't seen elsewhere on Cody. Switch the byte order of the input (i.e. if little-endian -> big...

casi 12 años hace

Respondida
How to rearrange the rows of a matrix?
The trick is to use the index from sorting the first column: [~,idx] = sort(A(:,1)); B = A(idx,:);

casi 12 años hace | 0

| aceptada

Resuelto


Project Euler: Problem 9, Pythagorean numbers
A Pythagorean triplet is a set of three natural numbers, a b c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 =...

casi 12 años hace

Resuelto


Given a 4x4 matrix, swap the two middle columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

casi 12 años hace

Cargar más