Solved


Hilbert numbers
Given a positive integer, n, return h as follows: 1. If n is not a <https://en.wikipedia.org/wiki/Hilbert_number Hilbert numb...

4 years ago

Solved


Consecutive Pairs of Smooth Numbers from Set of Prime Numbers
Given an input set of prime numbers (p), generate all pairs of consecutive smooth numbers (x) (see Stormer's Theorem). For exam...

4 years ago

Problem


Consecutive Pairs of Smooth Numbers from Set of Prime Numbers
Given an input set of prime numbers (p), generate all pairs of consecutive smooth numbers (x) (see Stormer's Theorem). For exam...

4 years ago | 0 | 6 solvers

Answered
where to put "." notion in x(t) equations in MATLAB
y1=(e^(zeta*(-1)*t)).*((x0*cos(w0*sqrt(1-zeta^2)*t))+(v0+zeta*w0*x0)*... sin(sqrt(1-zeta^2)*t)/(w0*sqrt(1-zeta^2))); y2=(e...

4 years ago | 1

Solved


Weird Diagonal Matrix!!
**If you have loved the problem, please like it below(Request)** Given an integer n, create a matrix whose diagonal elements wi...

4 years ago

Solved


Draw a Diamond shape in ones Matrix with '0' s
Input will be odd numbers.The task is to make a Diamond shape in a ones matrix with '0's where the matrix will be a square matri...

4 years ago

Solved


Leyland Primes
A Leyland Number is defined as a number of the form - x^y + y^x, or, x^y - y^x (x,y)>1 Given an array of numbers(>1), check...

4 years ago

Answered
How to select specific number from column A based on column B
m=[24 12.4 46 10.3 35.2 93.2 743 105 585 11.2];%load as a matrix or convert table to matrix ta...

4 years ago | 0

| accepted

Solved


Compute the period of a pendulum started from a finite initial angle
Cody Problem 49830 asks for the period of a pendulum swinging through a small angle. Here the pendulum started at rest from an ...

4 years ago

Solved


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

Solved


Flip the parity of digits in a decimal expansion
The number 349 has the decimal expansion . If we change the even digits from positive to negative, then the number becomes 269 (...

4 years ago

Solved


Count the peaceful queens
In a 5x5 chessboard with a queen of one color (white, say) on the perimeter, one can place 12 black queens on the board such tha...

4 years ago

Answered
How to replace unique interval of columns in each row of a matrix with zero?
Why is a for-loop not acceptable? for k=1:length(idx_column) A1(k,1:idx_column(k))=0; end

4 years ago | 0

Solved


List odd twin composites
Twin primes, or prime numbers that differ by 2 (e.g., 17 and 19, 59 and 61, or 191 and 193), are the subject of several Cody pro...

4 years ago

Answered
I have matrix K and Z
s=logical(sum(Z,2)); K(s,:)=0;

4 years ago | 0

Answered
Index exceeds the number of array elements - Error message
mdata = [1 2 3 4 5 6 7 8 9 10]; k = 1; c = 1; for n1 = 1:2:length(mdata) ma(c) = (1/(k + 1)) * sum(mdata(n1:n1 + k))...

4 years ago | 0

Solved


Convert single-precision floating-point number to binary representation
Write a function which takes a scalar <http://en.wikipedia.org/wiki/Single-precision_floating-point_format single-precision floa...

4 years ago

Solved


Convert base 10 to base x (2-16)
Convert input number(s) (cell array of character arrays) in base 10 to base x (2 through 16). Output should be a cell of charact...

4 years ago

Answered
Finding the max value in 1st column of values based on a range in the 2nd column of values
idx=(FFTDataCKASRoll(:,2)>=.09&FFTDataCKASRoll(:,2)<=.11)|... (FFTDataCKASRoll(:,2)>=.19&FFTDataCKASRoll(:,2)<=.21)|... ...

4 years ago | 0

| accepted

Answered
How to averaging each each row in cell array?
d=cell2mat(dst_allfiles); m=mean(d,2);

4 years ago | 0

| accepted

Answered
What is the best way to define an output vector in this case?
I assume you mean a 10-element vector. for k=1:1000 yourVector=;%computation to compute your vector yourMatrix(k,:)=y...

4 years ago | 0

| accepted

Answered
Why does matlab not evaluate equations properly?
syms x f=log(.7*x+.5); x0=4.2857; t=taylor(f,x,x0,'Order',2); a= double(subs(t,6.42855))

4 years ago | 0

| accepted

Answered
why do I get the wrong angle
Recommend avoiding using symbolics. Seeking numerical solution, use fzero. mo=2.5; y=1.4; angle=10; fun=@(a)((2*(1+((y-1)/2)...

4 years ago | 0

Answered
why I get imaginary part using solve function
y=1.4; to3=300; t_star=400; eq4=@(m4)(((2*(y+1)*m4^2*(1+(y-1)/2)*m4^2))/(1+y*m4^2)^2)-to3/t_star; m_4=fzero(eq4,.8)

4 years ago | 0

Answered
Append values of nested loop into matrix
r=readmatrix('data_jong_edit.txt'); r(isnan(r(:,1)),:)=[]; u=unique(r(:,1)); for k=1:length(u) re=r(r(:,1)==u(k),:); ...

4 years ago | 0

Answered
why my plots are getting replaced after every simulation?
Question is confusing on figure numbering. Below saves 48 figures (16 each of s1, s2, and s3). Since you are saving the figures,...

4 years ago | 0

Answered
How to duplicate some values in vector , while each value is duplicate in different number of times?
a=[1 0 2 0 3 0 3 0]; d=4*(a>0)+3*(a==0); n=repelem(a,d);

4 years ago | 1

| accepted

Answered
Why am I getting error "Vectors must be the same length" although they are of same length?
You have two 'Trial40' plot(subject_data.xcoordinates2{find(subject_data.trialname == 'Trial40',1)}, ... subject_data.ycoo...

4 years ago | 1

Answered
How to determine the reverse saturation current
missing * and some () in last equation N_a=1.0*10^22; N_d=1.0*10^22; ni=1.5*10^16; D_n=0.0025; tao_p0=5*10^(-7); tao_n0=5*...

4 years ago | 0

Answered
Single bit read returning invalid precision
b=fread('a.wdq',1,'ubit1');%this does not work?

4 years ago | 0

Load more