Answered
How to get equation of signal in matlab
I am not certain what you intend by getting an equation for it. You _can_ filter out the noise to see the general trend: ...

9 years ago | 2

| accepted

Answered
Using previous values to calculate next one in a for loop
If you begin with *|‘i’|* that is at least *|3|*, and you have already defined two previous values for your variables, you can u...

9 years ago | 0

| accepted

Answered
axis labels in 3D mesh
This has been a problem as long as I can remember. There is a File Exchange contribution, <https://www.mathworks.com/matlabcent...

9 years ago | 1

Answered
How do I plot multiple ,different sized arrays on one scatter plot and get the legend to match with the specified colors?
Create handles to each *|scatter|* call, and then use them as arguments to your *|legend|* call: figure h1 = scatter(Sh...

9 years ago | 0

Answered
How do I take a large table, split it into smaller chunks, and add them to a new table?
Try this: v1 = rand(100,1); % Create Data v2 = rand(100,1); ...

9 years ago | 0

Answered
How to create a cell with multiple entries in one line of code?
You can just use curly brackets *|‘{}’|* to create it as a cell array: Group = {75,1,1:25,1,'first',26:50,1, 'second', 51:...

9 years ago | 0

| accepted

Answered
How can I let Matlab to put different numbers in different variables?
You have *|1|* equation in *|7|* unknowns, so you will get an infinity of solutions. Solving it seems to be pointless. To ...

9 years ago | 0

Answered
How to compare a series of 50 values to a single value for each sample in a plot?
I am not certain what you want. See if this works for you: y = sort(rand(50,5)); % Depe...

9 years ago | 0

Answered
How to access specific elements of an array?
One approach: ix = sub2ind(size(A), x(:,1), x(:,2)); % Change Subscripts To Linear Index Vector A(ix) = 5;...

9 years ago | 1

| accepted

Answered
terminating the while if loop
I would add a *|break|* or *|return|* in your *|if|* block: if iteration>=1000 warndlg('iteration cannot be converge...

9 years ago | 1

| accepted

Answered
Setting x-axis values
In the second figure, I would divide the *|x|*-axis values by *|96|*, then plot your data: plot(fix(x/96), y)

9 years ago | 1

Answered
Why is get(gcf, 'children') inconsistent for the same figure handle? Messes up my bode plot when calling my function twice to draw into the same figure.
To plot the values *|bode|* calculates as normal *|subplot|* plots, call *|bode|* with output arguments: [mag,phs,wout] = ...

9 years ago | 0

| accepted

Answered
Hi, how do I import a 3D image into MATLAB?
Use the <https://www.mathworks.com/help/matlab/ref/imread.html *|imread|*> (link) function.

9 years ago | 0

Answered
How to activate the code command gershband(sys)
You have to download the <https://www.mathworks.com/matlabcentral/fileexchange/10816-mimo-toolbox *MIMO Toolbox*> (link) from th...

9 years ago | 0

Answered
inverting Z axis in plot
You only need to reverse the Z-tick labels. The plot will stay as it was. *_Example_ —* x = linspace(-1, 1, 25); ...

9 years ago | 0

| accepted

Answered
Is there a way to split hex data in to several part?
This seems to work: Nx = 'ADAEB3'; Nxc = mat2cell(Nx, 1, [2 2 2]); % Convert To Cell Array [e,f,g] = Nxc...

9 years ago | 0

Answered
Textscan doesn't do what it's told
I cannot follow your code. However, using *|frewind|* repositions the file pointer at the beginning of the file. I would use t...

9 years ago | 1

Answered
Acceleration vs Time; Magnitude vs Frequency
Try this: % Plot FFT signal N = pow2(nextpow2(length(signal))); y = fft(signal,N)/length(signal); Fn = Fs/2; F...

9 years ago | 0

| accepted

Answered
plotting fft with respect to reference signal
You have not described what you want to do and what result you want. If both signals were acquired at the same times (with ...

9 years ago | 0

| accepted

Answered
Divide data and take the median
If you want to take the median of *|‘b(1:20)’|*, *|‘b(21:40)’|*..., this works: med_b = median(reshape(b(:), 20, []));

9 years ago | 0

| accepted

Answered
Sum over rows in a matrix for specific numbers in the last column
More information about column *|5|* would be helpful. If column *|5|* goes from *|1|* to *|4|* and then repeats (regardless...

9 years ago | 1

Answered
How can I make a custom random number distribution?
In the Statistics and Machine Learning Toolbox, you can generate random numbers from any of the supported <https://www.mathworks...

9 years ago | 0

Answered
Adding plot titles based on excel file name in a for loop
Use the *|fileparts|* function to get the file name: ... [~,filename] = fileparts(filepath); figure(i); [ax,h1,h2...

9 years ago | 0

Answered
How do I align decimal points in a table?
Applying a particular format to a *|table|* does not appear to be an option. It does not even inherit the current *|format|* se...

9 years ago | 0

Answered
how to show title msgbox complete
You can use the *|'Position'|* property to lengthen the size of the message box: h = msgbox('Test Long Title','This is a v...

9 years ago | 1

Answered
Lines on 3D surface plot
I am not certain exactly what you want. This should at least get you started: figure surf(X,Y,Z) s=surf(X,Y,Z,'...

9 years ago | 0

| accepted

Answered
I need to align two signals that have a time shift to be able to take the differential of them
I would use the <http://www.mathworks.com/help/signal/ref/alignsignals.html *|alignsignals|*> (link) function. There are relate...

9 years ago | 0

Answered
Efficient way to find the eventual slope of graph?
If you are only interested in the slope near the *_end_* of your data, this could work: *_Example_ —* x = Your_Indepen...

9 years ago | 0

Answered
i have the following array
One approach: Z=[22,45,65,35,65,54,45,67,84,95,86,58,29,95,93]; Out = Z(randperm(numel(Z),5)) The *|randperm|* funct...

9 years ago | 0

| accepted

Answered
Filter testing in FDA toolbox
I cannot find any reference to the ‘FDA Toolbox’ in the online documentation or in the File Exchange. Giving correct inform...

9 years ago | 0

Load more