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

12年弱 前 | 0

解決済み


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

12年弱 前

回答済み
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...

12年弱 前 | 0

解決済み


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

12年弱 前

解決済み


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

12年弱 前

解決済み


Narcissistic problem
How many likes has this problem?

12年弱 前

回答済み
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 ...

12年弱 前 | 0

回答済み
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...

12年弱 前 | 0

| 採用済み

回答済み
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...

12年弱 前 | 1

| 採用済み

解決済み


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

12年弱 前

解決済み


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

12年弱 前

質問


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

12年以上 前 | 4 件の回答 | 2

4

回答

回答済み
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 ...

12年以上 前 | 0

回答済み
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...

12年以上 前 | 1

回答済み
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...

12年以上 前 | 0

回答済み
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...

12年以上 前 | 0

| 採用済み

解決済み


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

12年以上 前

解決済み


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

12年以上 前

解決済み


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

12年以上 前

解決済み


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

12年以上 前

解決済み


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

12年以上 前

解決済み


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.

12年以上 前

解決済み


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

12年以上 前

解決済み


Celcius to Kelvin
Convert Celsius degrees to Kelvin temperature.

12年以上 前

解決済み


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

12年以上 前

解決済み


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

12年以上 前

解決済み


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

12年以上 前

回答済み
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,:);

12年以上 前 | 0

| 採用済み

解決済み


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

12年以上 前

解決済み


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

12年以上 前

さらに読み込む