문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

문제를 풀었습니다


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

14년 초과 전

답변 있음
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...

14년 초과 전 | 0

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

14년 초과 전 | 4

| 수락됨

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

14년 초과 전 | 0

답변 있음
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...

14년 초과 전 | 0

답변 있음
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...

14년 초과 전 | 2

| 수락됨

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

14년 초과 전 | 0

답변 있음
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...

14년 초과 전 | 8

| 수락됨

답변 있음
String Manipulation Syntax
fdata(:,1) = cellfun(@(x) x(4:8),fdata(:,1),'un',0)

14년 초과 전 | 0

| 수락됨

답변 있음
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

14년 초과 전 | 0

| 수락됨

답변 있음
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...

14년 초과 전 | 1

답변 있음
Avoiding cross product for accessing the matrix
pos = sub2ind(size(A), r,c) A(pos)

14년 초과 전 | 1

| 수락됨

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

14년 초과 전 | 0

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

14년 초과 전 | 46

| 수락됨

답변 있음
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; ...

14년 초과 전 | 0

더 보기