A résolu


Calculate roots of polynomial given as vector array.
Calculate roots of polynomial given as vector array. Example x=[1 2 0 5 0 3] result=[-2.7267 ; ...

presque 10 ans il y a

A résolu


Find scalar product of two polynomials a and b, given as vector array.
Find scalar product of two polynomials given as vector array. Example a=[1 -1 2]; b=[2 4 1]; result=0

presque 10 ans il y a

A résolu


Return amount of palindromes in the string.
Example Input: s='eye story pop dictionary noon enjoy software moon' Output: amount=3

presque 10 ans il y a

A résolu


Counting candies
In a classroom of |'n'| children, every even numbered child gets one big candy and every odd numbered child gets two small candi...

presque 10 ans il y a

A résolu


Find Euclidean norm of given vector u.
Find Euclidean norm of given vector u. https://en.wikipedia.org/wiki/Euclidean_distance Example x=[1 1] result=sqrt(1^2+1^2...

presque 10 ans il y a

A résolu


Find cosine between two given vectors u and v.
Find cosine between two given vectors u and v. Example u = [5 2 0 5 3 0]; v = [3 2 5 1 ...

presque 10 ans il y a

A résolu


Numerate input arguments
For every input, output the number. Example: [a, b] = Test('first', 'second') a=1; b=2;

presque 10 ans il y a

A résolu


Calculate the eigenvalues of A.
Calculate the sum of the eigenvalues of A. If it's odd return cubed else return 54.

presque 10 ans il y a

A résolu


Find product of eigenvalues of n*n magic matrix.
Find product of eigenvalues of n*n magic matrix. Example n=3 Matrix= [ 8 1 6; 3 5 7; 4 ...

presque 10 ans il y a

A résolu


Find the product of the positive elements above the main diagonal.
Example Input A=[1 2; -3 0] Output 2

presque 10 ans il y a

A résolu


Calculate the sum of elements of n*n Hilbert matrix.
Calculate the sum of elements of n*n Hilbert matrix. Example n=5 HilbertMatrix=[1.0000 0.5000 0.3333 0.2500 ...

presque 10 ans il y a

A résolu


For given vectors x,y find coresponding spline coefficients.
For given vectors x,y find coresponding spline coefficients. Example x =[ -3 -2 0 2 3] y =[ 0 0 1 ...

presque 10 ans il y a

A résolu


Get linearly independent vectors of given matrix.
Get linearly independent vectors of given matrix. Example matrix=[ 3 -1 0 0 ; 0 3 0 0...

presque 10 ans il y a

A résolu


Calculate the centroid of a triangle
Info: https://en.wikipedia.org/wiki/Centroid Example Input: x = [0 0 1]; % x-coordinate y = [0 1 0]; % y-coordinat...

presque 10 ans il y a

A résolu


Square root of a number
Write a code that will output the square root of x.

presque 10 ans il y a

A résolu


What's size of TV?
Many people buy TV. Usually they ask about diagonal. But also important are width and height. Let's assume that all TV have rati...

presque 10 ans il y a

A résolu


isnan()
Replace all nans with zeros

presque 10 ans il y a

Réponse apportée
How do I generate a random number between two numbers, "n" number of times?
Without using a for-loop: a = 0; b = 255; n = 1000; x = a + (b-a).*rand(n,1); will generate n numbers randomly ...

presque 10 ans il y a | 1

Réponse apportée
Plotting the data if all the data point is to be represented by a vertical bar from the x-axis (y=0) to the value of y for that point
y = randi(10,1,10); % generate random data figure; hold on; for ii=1:length(y) plot([ii ii],[0 y(ii)],'b'); e...

presque 10 ans il y a | 1

| A accepté

Réponse apportée
Help converting cell to matrix of doubles (Large matrix)
I think datevec is what you want. d = datevec(data(:,1),'yyyy-mm-dd'); d = d(:,1:3); % if you only want to keep the year...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
How do seperate a string in different strings while not creating new strings for variables
For diversity of answers, here is another option (although I do not claim it is better than other answers!): str = '# Donal...

presque 10 ans il y a | 2

| A accepté

Réponse apportée
Is there a way to reduce the precision of Matlab overall?
Here is a simple way to change the precision of a result: n = 4; % number of desired decimal points x = round(x*10^n)/10...

presque 10 ans il y a | 1

Réponse apportée
Matlab delete's value's from array
Suppose you have an M-by-N matrix (A) of NaNs, 0s, and 1s: M = 3648; % number of rows N = 4; % number of columns A ...

presque 10 ans il y a | 0

Réponse apportée
check if url exists for large files without downloading the file
It seems I stumbled upon a similar approach to Steven, but a few minutes too late! I think this function would do the trick: ...

presque 10 ans il y a | 0

Réponse apportée
a matlab code of getting a value uniformly at random from a the set {-1,1}
To generate values uniformly from the set {-1,1}, use: N = 100; x = 2*(rand(N,1)>0.5)-1; where N is the number of val...

presque 10 ans il y a | 2

A résolu


calculate the day of the year from a date string.
'09-Oct-2016' is the 283rd day of the year. So doy = dayoftheyear('09-Oct-2016') should return doy = 283

presque 10 ans il y a

A résolu


Implement zero-based indexing for Matrices
Given an input vector and position (which is zero based) output the value Example: x = [1 2; 4 5] pos = [0 1] value = 5 ...

presque 10 ans il y a

A résolu


Triplicate me
Given an input vector, output a 3n vector with all elements of input vector repeated thrice Example : in->[1 2 3 5] out...

presque 10 ans il y a

A résolu


Calculate correlation.
There are two data. y1=[0 1 2 3 4]' y2=[2 3 4 5 6]' We can see positive relationship between y1 and y2. The relations...

presque 10 ans il y a

Charger plus