A résolu


Remove all the words that end with "ain"
Given the string s1, return the string s2 with the target characters removed. For example, given s1 = 'the main event' your ...

plus de 6 ans il y a

A résolu


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

plus de 6 ans il y a

Réponse apportée
how to sum data with condition
This is silly. But not difficult to implement. x = [1 100; 1 101 ; 1 102; 2 109 ; 2 116 ; 2 118 ; 2 120 ; 3 103; 3 106]; y = x...

plus de 6 ans il y a | 0

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

plus de 6 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...

plus de 6 ans il y a

A résolu


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

plus de 6 ans il y a

A résolu


Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

plus de 6 ans il y a

A résolu


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

plus de 6 ans il y a

A résolu


Alphabetize by last name
Given a list of names in a cell array, sort the list by the last name. So if list = {'Barney Google','Snuffy Smith','Dagwood ...

plus de 6 ans il y a

Réponse apportée
How do I break the line for every 50th row in a matrix
Fairly simple. Just need to reshape the variables. Here is an example: d = 10; x = repmat(1:d,1,d)'; y = [sin(x)]; t = 1:len...

plus de 6 ans il y a | 0

Réponse apportée
Index 2D matrix along line rotated about the matrix midpoint
360/(N-1) doesn't make sense. What if N = 8? I think you just mean 180. But it's irrelevant. It would not be efficient to recrea...

plus de 6 ans il y a | 0

Réponse apportée
Why can't I solve this, it's simple. (Incorrect dimensions.... use .^) (I did then it says Invalid Operator.......)
This works fine: z = ((x+1).^y)-(x.^y); You should read a bit on the difference between array and matrix operations. https://...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
incorrect result of fft phase calculation
There are two issues at play. The first is a trade-off between temporal resolution and spectral resolution. Your sampling freque...

plus de 6 ans il y a | 0

Réponse apportée
How to correct error in port width or dimension in simulink?
Reshape the signal going into 'ref' with a Reshape block, and select column vector as the output dimensionality.

plus de 6 ans il y a | 0

Réponse apportée
Function for even or odd numbers
function y = iseven(v) y = all(~mod(v,2)); end

plus de 6 ans il y a | 0

Réponse apportée
List comprehension-like function in assigning values in nested structures
You'll find the answer in this article on comma-separated lists, specifically with the _deal()_ function. <https://www.mathwork...

plus de 6 ans il y a | 1

Réponse apportée
How to stop for-loop outside of the loop?
Sounds like you want a GUI of a stop watch. https://www.mathworks.com/matlabcentral/fileexchange/12628-stopwatch

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Multiple Summation of Series using For Loops
Very close. You need to reset the value of s for each y. I also cleaned it up a bit. This now produces the specified figure. c...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
how i implement this equation.
Why do you want a loop to do this simple equation anyways? Ok here you go... clearvars; Ne = 9; Ni = 100; Eci = rand(Ni,Ne);...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Error using odearguments (line 113) Inputs must be floats, namely single or double.
Your function dynamics takes as inputs x and y, but instead uses t and y. So fix that. You are also passing in a symbolic value...

plus de 6 ans il y a | 0

Réponse apportée
Find the two nearest points from an array given a value
[~,k] = mink(abs(A-0.1400),2);

plus de 6 ans il y a | 4

| A accepté

Réponse apportée
How to filter data using rmoutliers?
If you have a hard threshold you want to use, then rmoutliers is not the function you want. Just use a simple logical index to g...

plus de 6 ans il y a | 1

Réponse apportée
Calculate the FFT of an ECG signal
I haven't ran your code but the plot looks pretty normal. The peak you see around 0 Hz is a DC component added to your signal. Y...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
How vectorize this operation
If you have the signal toolbox, you can use the buffer() command to an array of the x values that you require, then do the matri...

plus de 6 ans il y a | 0

Réponse apportée
Finding change in a large dataset
I agree with what Adam says in that there are certainly more efficient ways to solve this problem. That being said, I didn't hav...

plus de 6 ans il y a | 0

Réponse apportée
How do I make gaps in missing data plot lines?
help plot You are the one telling Matlab to plot a line between your data points. Try plot(x,y,'c.')

plus de 6 ans il y a | 0

Réponse apportée
using relational operators on array and element
if y>=var1 & y<=var2; var1 = 4 -1 -6 -11 -16 var2 = 6 1 -4 -9 -14 Let's say y = 5, so the condition abo...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Is there a way to avoid repeating time-consuming calculations from odefun in the events function?
You might find this comment by Walter Roberson useful, where he talks about using memoize().

plus de 6 ans il y a | 0

Réponse apportée
peak to peak amplitude comparison
You can't find the peak of a single data point. It is telling you to provide more data points in order for the function to work....

plus de 6 ans il y a | 0

| A accepté

Charger plus