Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

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

mehr als 14 Jahre vor | 1

| akzeptiert

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

mehr als 14 Jahre vor | 0

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

mehr als 14 Jahre vor | 0

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

mehr als 14 Jahre vor | 0

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

mehr als 14 Jahre vor | 0

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

mehr als 14 Jahre vor | 0

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

mehr als 14 Jahre vor | 0

| akzeptiert

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

mehr als 14 Jahre vor | 2

| akzeptiert

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

mehr als 14 Jahre vor | 0

| akzeptiert

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

mehr als 14 Jahre vor | 0

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

mehr als 14 Jahre vor | 2

| akzeptiert

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

mehr als 14 Jahre vor | 0

Beantwortet
Finding zeros of an equation
doc roots

mehr als 14 Jahre vor | 0

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

mehr als 14 Jahre vor | 0

| akzeptiert

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

mehr als 14 Jahre vor | 0

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

mehr als 14 Jahre vor | 0

| akzeptiert

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

mehr als 14 Jahre vor | 0

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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.

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

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

mehr als 14 Jahre vor | 5

| akzeptiert

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

Gelöst


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

mehr als 14 Jahre vor

Mehr laden