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

oltre 11 anni fa | 0

Risolto


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

oltre 11 anni fa

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

oltre 11 anni fa | 0

Risolto


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

oltre 11 anni fa

Risolto


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

oltre 11 anni fa

Risolto


Narcissistic problem
How many likes has this problem?

oltre 11 anni fa

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

oltre 11 anni fa | 0

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

oltre 11 anni fa | 0

| accettato

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

oltre 11 anni fa | 1

| accettato

Risolto


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

oltre 11 anni fa

Risolto


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

oltre 11 anni fa

Domanda


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

oltre 11 anni fa | 4 risposte | 2

4

risposte

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

quasi 12 anni fa | 0

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

quasi 12 anni fa | 1

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

quasi 12 anni fa | 0

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

quasi 12 anni fa | 0

| accettato

Risolto


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

quasi 12 anni fa

Risolto


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

quasi 12 anni fa

Risolto


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

quasi 12 anni fa

Risolto


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

quasi 12 anni fa

Risolto


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

quasi 12 anni fa

Risolto


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.

quasi 12 anni fa

Risolto


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

quasi 12 anni fa

Risolto


Celcius to Kelvin
Convert Celsius degrees to Kelvin temperature.

quasi 12 anni fa

Risolto


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

quasi 12 anni fa

Risolto


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

quasi 12 anni fa

Risolto


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

quasi 12 anni fa

Risposto
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,:);

quasi 12 anni fa | 0

| accettato

Risolto


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

quasi 12 anni fa

Risolto


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

quasi 12 anni fa

Carica altro