Resuelto


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

más de 6 años hace

Resuelto


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

más de 6 años hace

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

más de 6 años hace | 0

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 6 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 6 años hace

Resuelto


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

más de 6 años hace

Resuelto


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

más de 6 años hace

Resuelto


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

más de 6 años hace

Resuelto


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

más de 6 años hace

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

más de 6 años hace | 0

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

más de 6 años hace | 0

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

más de 6 años hace | 0

| aceptada

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

más de 6 años hace | 0

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

más de 6 años hace | 0

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

más de 6 años hace | 0

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

más de 6 años hace | 1

Respondida
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

más de 6 años hace | 0

| aceptada

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

más de 6 años hace | 0

| aceptada

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

más de 6 años hace | 0

| aceptada

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

más de 6 años hace | 0

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

más de 6 años hace | 4

| aceptada

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

más de 6 años hace | 1

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

más de 6 años hace | 1

| aceptada

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

más de 6 años hace | 0

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

más de 6 años hace | 0

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

más de 6 años hace | 0

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

más de 6 años hace | 1

| aceptada

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

más de 6 años hace | 0

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

más de 6 años hace | 0

| aceptada

Cargar más