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

mehr als 11 Jahre vor | 0

Gelöst


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

mehr als 11 Jahre vor

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

mehr als 11 Jahre vor | 0

Gelöst


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

mehr als 11 Jahre vor

Gelöst


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

mehr als 11 Jahre vor

Gelöst


Narcissistic problem
How many likes has this problem?

mehr als 11 Jahre vor

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 0

| akzeptiert

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

mehr als 11 Jahre vor | 1

| akzeptiert

Gelöst


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

mehr als 11 Jahre vor

Gelöst


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

mehr als 11 Jahre vor

Frage


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

mehr als 11 Jahre vor | 4 Antworten | 2

4

Antworten

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

fast 12 Jahre vor | 0

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

fast 12 Jahre vor | 1

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

fast 12 Jahre vor | 0

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

fast 12 Jahre vor | 0

| akzeptiert

Gelöst


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

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

Gelöst


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.

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

Gelöst


Celcius to Kelvin
Convert Celsius degrees to Kelvin temperature.

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

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

fast 12 Jahre vor | 0

| akzeptiert

Gelöst


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

fast 12 Jahre vor

Gelöst


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

fast 12 Jahre vor

Mehr laden