Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


isnan()
Replace all nans with zeros

más de 9 años hace

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

más de 9 años hace | 1

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

más de 9 años hace | 1

| aceptada

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

más de 9 años hace | 0

| aceptada

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

más de 9 años hace | 2

| aceptada

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

más de 9 años hace | 1

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

más de 9 años hace | 0

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

más de 9 años hace | 0

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

más de 9 años hace | 2

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Resuelto


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

más de 9 años hace

Cargar más