Resuelto


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

alrededor de 14 años hace

Resuelto


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

alrededor de 14 años hace

Resuelto


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

alrededor de 14 años hace

Resuelto


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

alrededor de 14 años hace

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

alrededor de 14 años hace | 1

| aceptada

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

alrededor de 14 años hace | 0

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

alrededor de 14 años hace | 0

Respondida
sorting a matrix in descending order
sort(group,1,'descend')

alrededor de 14 años hace | 0

Respondida
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;

alrededor de 14 años hace | 0

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

alrededor de 14 años hace | 0

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

alrededor de 14 años hace | 0

| aceptada

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

alrededor de 14 años hace | 2

| aceptada

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

alrededor de 14 años hace | 0

| aceptada

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

alrededor de 14 años hace | 0

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

alrededor de 14 años hace | 2

| aceptada

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

alrededor de 14 años hace | 0

Respondida
Finding zeros of an equation
doc roots

alrededor de 14 años hace | 0

Respondida
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],[...

alrededor de 14 años hace | 0

| aceptada

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

alrededor de 14 años hace | 0

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

alrededor de 14 años hace | 0

| aceptada

Respondida
find distance between random points.
hypot(x,y)

alrededor de 14 años hace | 0

Resuelto


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

alrededor de 14 años hace

Resuelto


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.

alrededor de 14 años hace

Resuelto


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

alrededor de 14 años hace

Resuelto


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

alrededor de 14 años hace

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

alrededor de 14 años hace | 5

| aceptada

Resuelto


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

alrededor de 14 años hace

Resuelto


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

alrededor de 14 años hace

Resuelto


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

alrededor de 14 años hace

Cargar más