已回答
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...

6 years 前 | 0

已回答
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.')

6 years 前 | 0

已回答
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...

6 years 前 | 1

| 已接受

已回答
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().

6 years 前 | 0

已回答
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....

6 years 前 | 0

| 已接受

已回答
Multiple sine periods with a specific fundamental frequency
%%Time specifications: Fc = 100; % fundamental Fs = 20*Fc; % sampling rate dt = 1/Fs; % sampling period StopT...

6 years 前 | 1

已回答
How to display unique error message in function code?
You need to manually check the input arguments yourself. For example: function returnVec = repvec(vec, s) if ~isvecto...

6 years 前 | 0

| 已接受

已回答
Invalid Index in position 2
First, rename the variable eps to something else, because you are overloading the built-in Matlab function eps() which is bad pr...

6 years 前 | 0

已回答
How to create groups by using labels?
I don't recommend making variables dynamically for various reasons, but making a struct is fine to do, and can even make fieldna...

6 years 前 | 0

已回答
finding the intersection for a trace to a threshold
You can get the closest data points on either side of the threshold very easily. location = threshold >= data; % locati...

6 years 前 | 0

| 已接受

已回答
Delete specific rows in table
T(T.cell_type~=4,:) = []; % where T is the name of your table

6 years 前 | 0

| 已接受

已回答
Loops, Arrays, Average, and 3D shapes display help? please and thank you
I suggest you take the <https://www.mathworks.com/learn/tutorials/matlab-onramp.html MATLAB onramp course.>

6 years 前 | 0

已回答
what does the string #ok<NASGU> mean in the code editior
Matlab's code analyzer, mlint, includes a wide range of warning messages about possible problems or inefficiencies in the analyz...

6 years 前 | 3

| 已接受

已回答
cut video with beginning and end frame number
I'm not sure the size of your video data, but observe the following: x = rand(50,60,1000); whos x % x = [50, 60, 100...

6 years 前 | 0

| 已接受

已回答
How to split vibration data into different cycles
Perhaps an even easier method is to use a moving RMS calculation over a small time window. You should know what a reasonable rms...

6 years 前 | 3

| 已接受

已回答
How to split vibration data into different cycles
So there are lots of ways to do this. Surely you could use one of the Name/Value pairs of findpeaks to help (like Threshold or M...

6 years 前 | 1

已回答
How to split vibration data into different cycles
This will depend on the characteristics of your vibration signal. Is it periodic and continuous vibration, where there is a cons...

6 years 前 | 1

已回答
How to save the output from a while loop?
Your question is unclear, and it seems you are a beginner to Matlab. I would suggest doing the Matlab on-ramp course. It should ...

6 years 前 | 0

已回答
Prevent function from printing to command window?
doc evalc

6 years 前 | 1

| 已接受

已回答
Select next discrete cell by vector direction
You have the distance to each cell as the following: [x,y,z] = ndgrid(-1:1); R = [z(:),y(:),x(:)]; R(14,:) = []; % since you ...

6 years 前 | 2

| 已接受

已回答
Multiplying every secound element in a vector with -1
Here is another way: function vny = byt_tecken(v) vny = v.*-(-1).^(1:numel(v)); end

6 years 前 | 3