A résolu


Remove the vowels
Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

environ 14 ans il y a

A résolu


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

environ 14 ans il y a

A résolu


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

environ 14 ans il y a

A résolu


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

environ 14 ans il y a

A résolu


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

environ 14 ans il y a

A résolu


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

environ 14 ans il y a

A résolu


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

environ 14 ans il y a

A résolu


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

environ 14 ans il y a

A résolu


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

environ 14 ans il y a

A résolu


Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Example...

environ 14 ans il y a

A résolu


Add two numbers
Given a and b, return the sum a+b in c.

environ 14 ans il y a

A résolu


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

environ 14 ans il y a

A résolu


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

environ 14 ans il y a

A résolu


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

environ 14 ans il y a

A résolu


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

environ 14 ans il y a

A résolu


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

environ 14 ans il y a

Réponse apportée
A better way to loop
|If| is a control flow statement not a loop. Don't indent the if conditions if they are not nested. if b~=n & b<n & b==1...

environ 14 ans il y a | 0

Réponse apportée
How to disable fmincon from output notices?
Check the display option: http://www.mathworks.co.uk/help/toolbox/optim/ug/fmincon.html#f854721

environ 14 ans il y a | 4

| A accepté

Réponse apportée
find array/matrix max value and position
Look at the second output argument of the |max| function. [m,idx] = max(p)

environ 14 ans il y a | 0

Réponse apportée
Creating and naming arrays on the fly
Use structures: c = {'name1','name2','name3'}; for n = 1:numel(c) s.(c{n}) = fetch... end Or read <http://m...

environ 14 ans il y a | 0

Réponse apportée
Sort cell strings according to specific subsets of those cell strings
% Split using |'.'| as the delimiter splt = regexpi(filename,'\.','split'); % Sort according to the 8th and 10th col...

environ 14 ans il y a | 2

| A accepté

Réponse apportée
repeat element in an array
combinator(3,3,'p','r') On the fex: http://www.mathworks.com/matlabcentral/fileexchange/24325-combinator-combinations-and-per...

environ 14 ans il y a | 0

Réponse apportée
Create a monthly date vector of serial numbers
You are "almost" right, but what you're saying to matlab with, datenum({'01-Jan-1900':'01-Nov-2011'}) is: _"Take the strin...

environ 14 ans il y a | 8

| A accepté

Réponse apportée
String Manipulation Syntax
fdata(:,1) = cellfun(@(x) x(4:8),fdata(:,1),'un',0)

environ 14 ans il y a | 0

| A accepté

Réponse apportée
how solve 1 unknown varible function?
fsolve(@(x) (2*x+4)/(x+2)-5,0) And the equation you propose has no solution because |x+2| simplifies away

environ 14 ans il y a | 0

| A accepté

Réponse apportée
Generating a string of random standard normal variables that are correlated
Given a correlation matrix |C = A*A'|, then |A = P*sqrt(D)|, where: [P,D] = eig(C); % spectral decomposition To get the...

plus de 14 ans il y a | 1

Réponse apportée
Avoiding cross product for accessing the matrix
pos = sub2ind(size(A), r,c) A(pos)

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
how to use command "dir"
You can look for a specific extension: dir 'C:\Users\Oleg\Desktop\*.jpg'

plus de 14 ans il y a | 0

Réponse apportée
count rows in matrix ?
size(A,1) The following documentation provides more information on 'size' function: https://www.mathworks.com/help/matlab/ref/...

plus de 14 ans il y a | 46

| A accepté

Réponse apportée
Storage of a loop from negative number
Loop version: z = zeros(1,301^2); n = 0; for x =-1.5:0.01:1.5 for y =-1.5:0.01:1.5 n = n+1; ...

plus de 14 ans il y a | 0

Charger plus