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

plus de 11 ans il y a | 0

A résolu


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

plus de 11 ans il y a

Réponse apportée
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...

plus de 11 ans il y a | 0

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

A résolu


Narcissistic problem
How many likes has this problem?

plus de 11 ans il y a

Réponse apportée
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 ...

plus de 11 ans il y a | 0

Réponse apportée
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...

plus de 11 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 11 ans il y a | 1

| A accepté

A résolu


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

plus de 11 ans il y a

A résolu


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

plus de 11 ans il y a

Question


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

environ 12 ans il y a | 4 réponses | 2

4

réponses

Réponse apportée
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 ...

environ 12 ans il y a | 0

Réponse apportée
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...

environ 12 ans il y a | 1

Réponse apportée
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...

plus de 12 ans il y a | 0

Réponse apportée
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...

plus de 12 ans il y a | 0

| A accepté

A résolu


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

plus de 12 ans il y a

A résolu


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

plus de 12 ans il y a

A résolu


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

plus de 12 ans il y a

A résolu


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

plus de 12 ans il y a

A résolu


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

plus de 12 ans il y a

A résolu


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.

plus de 12 ans il y a

A résolu


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

plus de 12 ans il y a

A résolu


Celcius to Kelvin
Convert Celsius degrees to Kelvin temperature.

plus de 12 ans il y a

A résolu


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

plus de 12 ans il y a

A résolu


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

plus de 12 ans il y a

A résolu


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

plus de 12 ans il y a

Réponse apportée
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,:);

plus de 12 ans il y a | 0

| A accepté

A résolu


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

plus de 12 ans il y a

A résolu


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

plus de 12 ans il y a

Charger plus