Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


isnan()
Replace all nans with zeros

fast 10 Jahre vor

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

fast 10 Jahre vor | 1

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

fast 10 Jahre vor | 1

| akzeptiert

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

fast 10 Jahre vor | 0

| akzeptiert

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

fast 10 Jahre vor | 2

| akzeptiert

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

fast 10 Jahre vor | 1

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

fast 10 Jahre vor | 0

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

fast 10 Jahre vor | 0

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

fast 10 Jahre vor | 2

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Gelöst


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

fast 10 Jahre vor

Mehr laden