Answered
Reverse order of X axis
Building on @Image Analyst's comment, reversing the x-tick labels Exp = 0:15; % Days to expiration P = linspace(10, 30, leng...

4 years ago | 1

| accepted

Answered
How to get a data set using Mean and standard deviation
mu=63; sigma=2.3; %generate normally distributed numbers y=randn(1,10); y=sigma*(y-mean(y))/std(y)+mu mean(y) std(y)

4 years ago | 1

| accepted

Answered
I want to obtain value of "W" for different combination of values of (psi,r) example. "W" for (psi=0.0001,r = 2.1891) ; (psi=0.001,r = 2.1940); (psi=0.01,r = 2.2373) and so on
%loop psi=[0.0001,0.001,0.01]; r=[2.1891,2.194,2.2373]; for i=1:numel(psi) W(i)=calculateW(psi(i),r(i)); end W %array...

4 years ago | 0

| accepted

Solved


Image Processing 2.1.1 Planck Integral
Integrate the Planck function in Lambda (um) at T (K) accurately and quickly to find Radiance for a Lambertian source. Planck...

4 years ago

Answered
find node with maximum degree
Your "label" seems incorrect. node=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]; degree=[11 11 12 10 15 10 8 14 12 1 8 6 2 18 5]; de...

4 years ago | 1

Solved


Choose group with people
How many ways can you choose n groups of n people from n^2 people, assuming the groups are distinct? The number of people is gi...

4 years ago

Solved


Split bread like the Pharaohs - Egyptian fractions and greedy algorithm
How would you split 5 loaves of bread among 8 people in all fairness? Get a hint from the Pharaohs. 5/8 = 4/8 + 1/8 , i.e. each ...

4 years ago

Solved


GJam: 2013 Rd1a Bullseye Painting
<http://code.google.com/codejam/contests.html Google Code Jam> 2013 Round 1a Bullseye challenge is to determine how many full ri...

4 years ago

Solved


GJam 2012 Qualifier: Tongues
This Challenge is a Warm-Up for <http://code.google.com/codejam/schedule.html Google Code Jam 2014> Qualifying round coming up o...

4 years ago

Solved


Looking for Squares
Need n squares that equal one square all together, none zero, none fractured. For example, calling squares(2) should output [16...

4 years ago

Solved


List Proth primes

4 years ago

Solved


Sum the elements in rows of the Levine triangle
The Levine triangle starts as follows: Row 0: 2 Row 1: 1 1 Row 2: 1 2 Row 3: 1 1 2 To construct each row, r...

4 years ago

Answered
How to set bottom repeating elements in matrix to NaN?
Edited as per a comment a=[1 2 3 2 1 3 3 1 1 3 1 2 1 2 3 3 2 1 1 2 1 2 1 3 1 2 3 1 2 1]; for j=1:2 ...

4 years ago | 0

Answered
Filter Matrix over a specific value
The new dimension would be 1x5, not 1x4 data=1:10 data(data>5)

4 years ago | 1

| accepted

Answered
check 2 same numbers in a matrix
y= [80 39 101 39 101 175 237 172 232 168 232 168 104 40] nnz(y==39)==2 nnz(y==168)==2

4 years ago | 1

| accepted

Solved


AES SubBytes() Transformation
Given a 16x2 input character hexadecimal array representing the AES state, execute the AES algorithm SubBytes() transformation a...

4 years ago

Answered
For loop to make an array from workspace variables
The way you have written your loop, the variable xlength gets overwritten every iteration. %Concatenating in a char array xlen...

4 years ago | 1

Answered
Limiting bulitin function (sine)
You have to call your function for each value of x and store it in another variable and then plot it, as your function is define...

4 years ago | 1

| accepted

Answered
how to return indices?
Based on your comment - %random data y=randi(30,2,3,4) z=NaN(2,3,4); z(y<15)=y(y<15)

4 years ago | 1

| accepted

Answered
How to remove rows in a cell array with a number of Nans major than a threshold
%random data y={NaN(1,50);[zeros(1,5) NaN(1,35) ones(1,25)];[primes(100) NaN(1,37)];... [0.5*(1+sqrt(5)) pi exp(1) NaN(1,5...

4 years ago | 1

| accepted

Answered
MATLAB is taking too much time to solve the following integral?
integral is used for numerical integration of functions, not partial integrations. It expects numerical value for 2nd and 3rd in...

4 years ago | 0

| accepted

Solved


Local Extrema
Given a 2D (m,n>1) matrix, replace an element if it is not a local extrema (minima/maxima), with 0 (zero). Check the 3 neighbou...

4 years ago

Answered
minimun value in a column matrix with its index
A=[0; 5 ;6 ;9 ;55] A(A~=0) %when you do this, your vector changes Method 1 minvalue=min(A(A~=0)) rowidx=find(A==minvalue) ...

4 years ago | 1

| accepted

Problem


Local Extrema
Given a 2D (m,n>1) matrix, replace an element if it is not a local extrema (minima/maxima), with 0 (zero). %Example x=[1 ...

4 years ago | 0 | 8 solvers

Answered
How to find peaks in matrix the rest are 0
Run a double for loop through all the elements A = randi(50,7,11) %sample matrix B=zeros(size(A)); for i=1:size(A,1) for...

4 years ago | 0

| accepted

Answered
Extract number from cell with decimal
y={44.10}; befdec=floor(y{1}) aftdec=rem(y{1},1)

4 years ago | 1

| accepted

Problem


Hyperperfect Numbers
A k-hyperperfect number is a natural number n for which the equality n = 1 + k(σ(n) − n − 1) holds, where σ(n) is the divisor ...

4 years ago | 1 | 4 solvers

Answered
How to save multiple matrices in multiple files? I solved the first two parts using for loop but couldn't do the 3rd one.How to save these multiple matrices in separate files?
%Saving magic matrices in files for n=1:7 A=magic(5*n+15); filenames=sprintf('magicmatrix_%d.mat',n); save(filen...

4 years ago | 1

| accepted

Solved


Count the ways to draw non-intersecting chords between points on a circle
There are 9 ways to draw non-intersecting chords between four points on the perimeter of a circle (including no chords at all). ...

4 years ago

Load more