Answered
Interpolation of values between the beginning and end of crank rotation
I would use the *|interp1|* funciton. Try this: t_original = [0, 1, 2, 3, 4]; angle = [350 , 355, 0.5, 2, 3]; t...

9 years ago | 0

Answered
Plotting a Surf of my waveform
I am not entirely certain what you want to do. If I understand your Question, you can take advantage of vector multiplicati...

9 years ago | 0

| accepted

Answered
FFT from .csv data file
You signal is simply broadband noise. I do not know how you want to _‘eliminate the vibration signals of scope_0 from scope_1’_...

9 years ago | 0

| accepted

Answered
How to include complex numbers in fprintf function?
you have to write the real and complex parts separately. *_Example_ —* x = sqrt(-2); fprintf(fid, '%f%+fj\n', real(...

9 years ago | 7

| accepted

Answered
Check for value in multiple columns and delete rows with that value
If *|‘M’|* is your matrix, this will work: idx = any(bsxfun(@eq, M(:,1), (M(M(:,3)==-1,1))'),2); Mout = M(~idx,:); T...

9 years ago | 0

| accepted

Answered
How to join all points in the plot.
First, remove the *|plot|* call from the loop. Second, create vectors for *|‘ea’|* and *|‘iter’|*. Third, plot the vec...

9 years ago | 0

| accepted

Answered
Coordinates of a vector
Try this: for i=1:4 [x{i},y{i}]=find(I==vector(i)); end

9 years ago | 0

Answered
Trying to generate a random matrix of latitude values between 0 and 90
I’m not certain what you want. Try this: R = rand(4); R = (R - min(R(:)))*90/(max(R(:))-min(R(:)));

9 years ago | 0

Answered
Adding numerical array to cell array
Try this: C={'Tom', 'Student', 'Jim', 'Faculty', 'Clare', 'Student'}; N=[100 120 140 160 180 200]; Nc = num2cell(N);...

9 years ago | 0

| accepted

Answered
Normalisation of FFT not consistent.
Three problems: n = 2^nextpow2(ds); % ← Use ‘ds’ Not ‘Fs’ Y = fft(D,n)/ds; ...

9 years ago | 0

| accepted

Answered
transfer function input format
Yes. This works (in *|R2017b)|*: s = tf('s'); sys = (s+1)*(s+2) sys = s^2 + 3 s + 2 Con...

9 years ago | 1

| accepted

Answered
Insert particular number on the figure using loop
Change the *|text|* call to: text(rad2deg(D_max(k)),rad2deg(B_max(k)), sprintf('M(%d)',M(k))) That should do what you w...

9 years ago | 0

| accepted

Answered
hello can some one help. I am to find peaks of accelrometer axis, for that am using the previously suggested code in this form,
You can create unique independent variable values from duplicated values by multiplying the duplicated-values vector by an incre...

9 years ago | 0

Answered
SAVING DATA FROM A LOOP THAT DOES NOT START FROM ONE OR NOT POSITIVE INTEGERS OR LOGICALS
If you want to use a *|for|* loop, you need to make a few changes: v = 0:0.1:10; % Create Values As ...

9 years ago | 0

| accepted

Answered
how can I plot measurement data without getting straight lines that match all points?
You are most likely doing nonlinear parameter estimation. See the documentation on <https://www.mathworks.com/help/stats/nlinfi...

9 years ago | 0

| accepted

Answered
getting intersected index without ruining an order of the original data.
Use the *|ismember|* function: A=[1234 345 675 11 2]; B=[345 2 11 2]; [~,C] = ismember(B,A) C = 2 ...

9 years ago | 0

| accepted

Answered
Finding the magnitude and phase of a variable in a complex equation in terms of variables only
I cannot follow everything you are doing. For some reason, *|abs|* is not computing the magnitude of the complex function. ...

9 years ago | 1

| accepted

Answered
solving ODE45 equation with a continuous updating input
I am not certain what you want to do. See the documentation on <https://www.mathworks.com/help/matlab/ref/ode45.html?s_tid=...

9 years ago | 0

Answered
converse the order of row or column vector
The easiest way is to use the <https://www.mathworks.com/help/matlab/ref/flip.html *|flip|*> (link) function (in *|R2013b|* and ...

9 years ago | 1

| accepted

Answered
How do I get the index of the element that's the start of an embedded vector within a longer vector? Order mainintained.
The *|strfind|* function will give you *|9|*: v = [1 2 4 7 6 9 5 3 4 6 7 12 10]; t = [4 6 7]; idx = strfind(v, t...

9 years ago | 0

Answered
Function definitions are not permitted in this context. runs online but not in the installed version. what is that I'm missing
Save your *|‘plot2fnhand’|* function as as separate file named *|plot2fnhand.m|*. Then call it in your script.

9 years ago | 0

Answered
I'm having trouble with this code.Error says:Subscript indices must either be real positive integers or logicals. Error in the equation for C
If you want *|‘C’|* to be a function, you need to write it as an anonymous function. See if this does what you want: ...

9 years ago | 0

Answered
patch which turns transparent at nan values?
Try something like this (in *|subplot(2,1,2)|*: x = linspace(0, 150); ...

9 years ago | 0

| accepted

Answered
How do I perform a different calculation on the elements in an array based on whether they are odd or even?
There are several ways to approach this. I would use ‘logical indexing’, and go from there: x = 1:3:90; even_x = rem...

9 years ago | 2

| accepted

Answered
X axis labeled with time only from 0 to 24
I am not certain what you want to do. See if this works: time = 0:47; ...

9 years ago | 0

| accepted

Answered
Matrix dimensions must agree error for addition
When in doubt, vectorize *_every_* multiplication, division, and exponentiation that does not specifically involve a scalar. I ...

9 years ago | 0

| accepted

Answered
how to create custom filter from FRF
There are some options in the Signal Processing Toolbox: * <https://www.mathworks.com/help/signal/ref/firls.html *|firls|*> ...

9 years ago | 0

Answered
fitcsvm don't work in Matlab R2013a
It was introduced in *|R2014a|*.

9 years ago | 0

Load more