Réponse apportée
'MarkerFaceColor' according to y value
x = linspace(0,3*pi,200); y = cos(x) + rand(1,200); sz = 25; c = y/max(y)*10; scatter(x,y,sz,c,'filled') hold on; plot(x,y...

presque 4 ans il y a | 0

A résolu


List the nth term of Rozhenko’s inventory sequence
Consider a sequence constructed by repeated inventories. A new inventory begins each time a zero is encountered. The first few i...

presque 4 ans il y a

A résolu


List numbers that are not in the Fibonacci sequence
In the list of 4797 Cody problems, 53 deal with or refer to the Fibonacci sequence.* What about the other numbers? Write a funct...

presque 4 ans il y a

Réponse apportée
Difference between x = 0:0.1:2*pi and linspace(0,2*pi,0.1)
Linspace divides the interval into the exact number specified, while colon notation just keeps increasing the interval by the mi...

presque 4 ans il y a | 1

| A accepté

A résolu


Slope intercept application
Find y given slope (m), x, and y intercept (b).

presque 4 ans il y a

A résolu


Easy Sequences 81: Fibonacci Radicals
The radical of a positive integer is defined as the product of the distinct prime numbers dividing . For example, the distinct ...

presque 4 ans il y a

A résolu


Check if a year is a leap year or not
Return 1 if a given year is a leap year or 0 if it is not

presque 4 ans il y a

A résolu


Remove Duplicates
Remove duplicates from the vector of integers and display in sorted order

presque 4 ans il y a

Réponse apportée
zeros populating most of my output vector
You will start running into problems with higher no_of_calls because the no_of_channels will increase and factorial numbers will...

presque 4 ans il y a | 1

| A accepté

A résolu


Compute the drag on a moving vehicle
We assume no rolling resistance, and the simple rule for Drag : , where is the density of the fluid (assumed at 1.2 ), is the ...

presque 4 ans il y a

A résolu


Determine if vector has any zeroes
Return 1 if vector has atleast 1 zero, else return 0

presque 4 ans il y a

Réponse apportée
Generate random numbers with truncated Pareto distribution
Just write a simple function function x = ranPareto_trunc(H,L,alpha,n)%H=upper, L=lower, alpha>0, n=number of random numbers de...

presque 4 ans il y a | 0

A résolu


Cricket - Career Batting Statistics
Given a vector s of strings representing a batter's individual innings scores, return their career statistics as a 4-element (nu...

presque 4 ans il y a

Réponse apportée
is it possible to make this code shorter?
r=x/2.*cos(cumsum(rad)); R=[r(1),2*cumsum(r(1:6))+r(2:7)]; mg=flip(cumsum(flip(Fz.*R))); c=-mg./rad;

presque 4 ans il y a | 0

A résolu


Cricket - How Much More to Beat Bradman?
Sir Don Bradman famously needed only 4 runs in his final innings to retire with an average of 100. Out for a duck, he ended inst...

presque 4 ans il y a

A résolu


Cricket - Average Partnership Contribution
The (infamous) Duckworth-Lewis method uses statistical models of how much each wicket partnership is worth to an innings (on ave...

presque 4 ans il y a

A résolu


Cricket - Sort Batters by Distance Run
Given a string vector of batters' names, a vector of the total number of runs they scored, a vector of the number of 4s they sco...

presque 4 ans il y a

A résolu


Easy Sequences 80: Sum of the n-th Row of Fibonacci Square Triangle
We shall call the following arrangement of Fibonacci numbers, as the Fibonacci Square Triangle: where...

presque 4 ans il y a

Réponse apportée
Randomize a marker color for a graph
m='o+*.x'; c='rgbcmyk'; x=randi(20,1,8); y=randi(20,1,8); figure;hold on; for n=1:length(x) scatter(x(n),y(n),'LineWidth...

presque 4 ans il y a | 0

Réponse apportée
why is this code not working?
Function works fine. f=@(x)x.^2.*sin(x)-x.*cos(x)+3;%sample function df=@(x)x.^2.*cos(x)+3*x.*sin(x)-cos(x); [root,iter,v]=ne...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
How to create a polar plot?
load S x = real(S); y = imag(S); rho = sqrt(x.^2+y.^2); theta = atan2(y,x);%use atan2 (4 quadrant) polarscatter(theta, rho,...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
custom distance with the kmeans
data=randi(100,10,2); centroid1=randi(100,1,2); centroid2=randi(100,1,2); m=sum(abs((data-centroid1)./std(data(:,1))),2); n=...

presque 4 ans il y a | 0

Réponse apportée
How to keep false as false, and not as zero
If you are just using false as a flag, change false into some other number flag. You could use a particular number that will nev...

presque 4 ans il y a | 1

| A accepté

A résolu


Cluster Partition
Given an array (row or column) of numbers, divide the array into consecutive positive/negative numbers. 0 is to be treated inde...

presque 4 ans il y a

A résolu


Find the dividend
Given a vector of pairwise coprime positive integers, p, and a vector of corresponding remainders, r, return a positive integer,...

presque 4 ans il y a

A résolu


Multiply each matrix element by its row index and add its column index.
Return a matrix the same size as the input, multiply each element by its row index and add its column index. Example: x = [ 1 ...

presque 4 ans il y a

Réponse apportée
how to get the same result using rand
s=sum(rand(2,1e6)-.5); histogram(s,40)

presque 4 ans il y a | 1

Réponse apportée
Grouping consectuve datapoints from a table into an array
Best to keep all the data together. Just reshape the array and index into it. pulse=reshape(yourTable.InstantPowerX,3,[])';%pul...

presque 4 ans il y a | 0

Réponse apportée
Plotting a scaler and adding a legend to graph
Look at legend to add an appropriate legend. % in m/s v= 0:1:261; AirDen= 1.225; CdA=0.501; coefficient =0.006; g=9.81; m...

presque 4 ans il y a | 0

Réponse apportée
How to dynamically name a large number of tall tables?
This should read all tables one at a time, combine the same categorical names, and store new tables as the categorical names. d...

presque 4 ans il y a | 0

| A accepté

Charger plus