已解决


Tricky timing
Write a function that takes between 0.5 seconds and 0.6 seconds to run.

12 years 前

已解决


2 b | ~ 2 b
Given a string input, output true if there are 2 b's in it, false if otherwise Examples: 'Macbeth' -> false 'Publius Cor...

12 years 前

已解决


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

12 years 前

已解决


Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

12 years 前

已回答
Copying non zero matrix to a zeros matrix
a = magic(3); padarray(a,[2 1]) ans = 0 0 0 0 0 0 0 0 0 0 0 ...

12 years 前 | 1

| 已接受

已回答
Solving Systems of Linear Equations
does this answer help? http://www.mathworks.com/matlabcentral/answers/24086-ols-regression-for-multiplr-ys-xs

12 years 前 | 0

已回答
generate random number GG distribution in matlab
r = randn(100,1) % 100 samples

12 years 前 | 0

已回答
sorting a matrix in descending order
sort(group,1,'descend')

12 years 前 | 0

已回答
Least square fit.
change line 81 to read plot(x1,y,'r*-'),grid on; by the way, a is more efficiently calculated as a = k\y;

12 years 前 | 0

已回答
How to find variance
unless I misunderstand your question, 95% is 1.96 standard deviations (two sided). You didn't mention if the 10 pixels are ±, s...

12 years 前 | 0

已回答
Lagrange Multipliers
here is a nudge to solving your problem syms x y L d = ??? % for you to fill out; distance from (-1,...

12 years 前 | 0

| 已接受

已回答
Working with polynoms
syms s >> expand((s+4)*(s+0.5-0.2*i)*(s+0.5+0.2*i)) ans = s^3 + 5*s^2 + (429*s)/100 + 29/25 >> fac...

12 years 前 | 2

| 已接受

已回答
finding distance from text data for latitude/longitude and creating new column of data for distance
the diff() function will calculate the difference for you without a loop. Here is a start: loc = [51.8885857 -2.15981330...

12 years 前 | 0

| 已接受

已回答
Finding zeros of an equation
if you *insist* on using a subfunction , consider the following: function x = myroots(y) % y is an integer range to find...

12 years 前 | 0

已回答
Using a loop to find out how long and how many terms
Check your math clc;clear dep = 10000; account = 10000; year = 0; while account < 1000000 year =...

12 years 前 | 2

| 已接受

已回答
Need to make a 4D plot (3D + Colour)
have a look at slice()

12 years 前 | 0

已回答
Finding zeros of an equation
doc roots

12 years 前 | 0

已回答
OVERLAY POINTS IN A MAP
simple example plots 3 sondes off the coast of the North America c = load('cape'); spy(c.X==1) hold plot([300,250,200],[...

12 years 前 | 0

| 已接受

已回答
problem with double integral, dblquad and quad2d
Use the matlabFunction() to change the symbolic equation to something dblquad can evaluate: f = matlabFunction(Easil) ...

12 years 前 | 0

已回答
quadl problem (Matrix dimensions must agree.).
You probably have to fully vectorize your calculations: .* % for multiply ./ % for divide .^ % for power

12 years 前 | 0

| 已接受

已回答
find distance between random points.
hypot(x,y)

12 years 前 | 0

已解决


Filter AC, pass DC
Input x is the sampled signal vector, may have both AC and DC components. Output vector y should not contain any AC component. ...

12 years 前

已解决


Back to basics 11 - Max Integer
Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

12 years 前

已解决


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

12 years 前

已解决


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

12 years 前

已回答
How to remove ticks from the x-axis?
set(gca,'XTick',[])

12 years 前 | 5

| 已接受

已解决


Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

12 years 前

已解决


Solve the Sudoku Row
*Description* A simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The ta...

12 years 前

已解决


Test for balanced parentheses
Given the input inStr, give the boolean output out indicating whether all the parentheses are balanced. Examples: * If ...

12 years 前

加载更多