문제를 풀었습니다


Pascal's Triangle
Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

13년 초과 전

문제를 풀었습니다


QWERTY coordinates
Given a lowercase letter or a digit as input, return the row where that letter appears on a <http://en.wikipedia.org/wiki/Keyboa...

13년 초과 전

문제를 풀었습니다


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

13년 초과 전

문제를 풀었습니다


Duplicates
Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

13년 초과 전

문제를 풀었습니다


Reverse Run-Length Encoder
Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

13년 초과 전

문제를 풀었습니다


Function Iterator
Given a handle fh to a function which takes a scalar input and returns a scalar output and an integer n >= 1, return a handle f...

13년 초과 전

문제를 풀었습니다


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

13년 초과 전

문제를 풀었습니다


Counting Sequence
Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

13년 초과 전

문제를 풀었습니다


Given a window, how many subsets of a vector sum positive
Given a vector: [1 0 -1 3 2 -3 1] and a window of 2, A sliding window would find: 1 + 0 = 1 0 - 1 = -1 ...

13년 초과 전

문제를 풀었습니다


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

13년 초과 전

문제를 풀었습니다


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

13년 초과 전

문제를 풀었습니다


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

13년 초과 전

문제를 풀었습니다


radius of a spherical planet
you just measured its surface area, that is the input.

13년 초과 전

답변 있음
Changing the bits randomly
or less brute force without a for loop: nInput = 1056; nShift = bin2dec('11111'); nOffset = nInput - nShift; ...

13년 초과 전 | 0

답변 있음
Changing the bits randomly
Try this, it is a somewhat brute force approach to solving your problem. The value 'nMatch' should give you the desired answer: ...

13년 초과 전 | 0

답변 있음
Undefined function 'eval' for input arguments of type 'double'.
You are getting that error because you are trying to evaluate a double. A double is just a double - there is nothing there to ev...

13년 초과 전 | 0

| 수락됨

답변 있음
How to write multiple if statements
You have too many 'end' statements within your code. An if-else statement should be formatted like this: if a == 1 % ...

13년 초과 전 | 4

| 수락됨

답변 있음
what should i do for error 'Undefined function or method 'state' for input arguments of type 'char' when using 'SS' command?
The state-space input matrices to the 'ss' command should all be numeric and have the following size relationships: A: p x ...

13년 초과 전 | 0

| 수락됨

답변 있음
count the duration for which variable value is zero in simulink
I'd take the input and convert it into a logical signal (1's and 0's), inverse this signal using a NOT block. Convert this back ...

13년 초과 전 | 1

| 수락됨

답변 있음
Extract numbers from mixed string
In order to extract a certain value: Str = ['Test setup: MaxDistance = 60 m, Rate = 1.000, ', ... 'Permitted Erro...

13년 초과 전 | 0

답변 있음
Up and down counter
I would suggest using either an integrator block with external initial conditions and a switched input, or design a Stateflow bl...

13년 초과 전 | 0

답변 있음
Control a Simulink module by an M-file
You are all making this more complicated than it actually is. Use the 'Step' block. Set the initial value to '100', set the fina...

13년 초과 전 | 0

답변 있음
How to create a loop calcualtion?
Here is an example of a quick loop that calculates a value based on the previous value. The loop simply calculates the value as ...

13년 초과 전 | 1

답변 있음
Finding specific phrases within a cell array (1)
See 'strtok' as one possible solutions. For example: celltxt{1} = 'EAST WINDS 15 TO 20 KNOTS. SEAS 4 TO 6 FEET.'; [tok, ...

13년 초과 전 | 1

| 수락됨

답변 있음
Error displayed : Undefined function or variable 'Tg'
Even if it is a global variable you still need to add it to your Embedded Function. Open your Embedded Function, then click ...

13년 초과 전 | 1

| 수락됨

답변 있음
Change the line color in subplot
An easier way might be to call 'hold all' after each subplot definition, and then just plot your values as normal. For example: ...

13년 초과 전 | 1

답변 있음
Error compounds adding date numbers
If you are using MATLAB date numbers they are stored as double precision numbers. This means the resolution of the date numbers ...

13년 초과 전 | 0

답변 있음
verification of the intepretation of a simple code that contains "isequalwithequalnans"
No, that interpretation is NOT correct. The statement says if BOTH b and c are different to a then 'Not ok'. Or in other wor...

13년 초과 전 | 0

답변 있음
Creating a matrix using for loop.
Try this: a = [0.12;0.1;0.2;0.3;0.4;0.5;0.6;0.7;0.8;0.9] f = zeros(length(a)); for b=length(a):-1:1 f(:,...

13년 초과 전 | 1

답변 있음
error in the output of "ss2tf"
I don't believe there is a problem. The ss2tf function only states that the numerator coefficients are returned in an array with...

13년 초과 전 | 0

| 수락됨

더 보기