Gelöst


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

mehr als 6 Jahre vor

Gelöst


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

mehr als 6 Jahre vor

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

mehr als 6 Jahre vor | 0

Gelöst


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

mehr als 6 Jahre vor

Gelöst


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

mehr als 6 Jahre vor

Gelöst


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

mehr als 6 Jahre vor

Gelöst


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

mehr als 6 Jahre vor

Gelöst


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

mehr als 6 Jahre vor

Gelöst


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

mehr als 6 Jahre vor

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

Beantwortet
Function for even or odd numbers
function y = iseven(v) y = all(~mod(v,2)); end

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 1

Beantwortet
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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
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);...

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 4

| akzeptiert

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

mehr als 6 Jahre vor | 1

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

mehr als 6 Jahre vor | 1

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

Beantwortet
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.')

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 1

| akzeptiert

Beantwortet
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().

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

Mehr laden