Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

Resuelto


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

más de 14 años hace

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

más de 14 años hace | 0

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

más de 14 años hace | 4

| aceptada

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

más de 14 años hace | 0

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

más de 14 años hace | 0

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

más de 14 años hace | 2

| aceptada

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

más de 14 años hace | 0

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

más de 14 años hace | 8

| aceptada

Respondida
String Manipulation Syntax
fdata(:,1) = cellfun(@(x) x(4:8),fdata(:,1),'un',0)

más de 14 años hace | 0

| aceptada

Respondida
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

más de 14 años hace | 0

| aceptada

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

más de 14 años hace | 1

Respondida
Avoiding cross product for accessing the matrix
pos = sub2ind(size(A), r,c) A(pos)

más de 14 años hace | 1

| aceptada

Respondida
how to use command "dir"
You can look for a specific extension: dir 'C:\Users\Oleg\Desktop\*.jpg'

más de 14 años hace | 0

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

más de 14 años hace | 46

| aceptada

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

más de 14 años hace | 0

Cargar más