Answered
Plot best fit line in log-space & get slope
You are regressing ‘log10(x)’ against ‘log10(y)’ so you need to give the appropriate information to both polyfit and polyval: ...

7 years ago | 0

| accepted

Answered
Plot the abs value of laplace transform for a function to be inputted by user
More details would help. I suspect you are using ‘G’ as a function in your test code, the reason it is not working as you exp...

7 years ago | 0

| accepted

Answered
Could't get right result laplace,ilaplace,PD
I have no idea what the plot is supposed to look like. However depending on your MATLAB release/version, you may have to use th...

7 years ago | 0

| accepted

Answered
Creating and coding MATLAB File to Analyse Equations
To begin to understand MATLAB, see Getting Started. You will need to write a script file that reads your data and then presen...

7 years ago | 0

Answered
Reading csv from the second line and creating output
Try this: name = tex(2:end,4) ‘Also, I would like to create a matrix that will inclue two columns that have come from comma...

7 years ago | 0

| accepted

Answered
Calculating the Workspace of a Robot
Probably the easiest way is to create your ‘theta’ variables as anonymous functions: theta1 = @(q1) q1 + pi/2; and so for th...

7 years ago | 0

Answered
how can I take a derivative of an array if there are NaN values?
If you have R2016a or later, one option would be to use the fillmissing function first. Also, depending on what you intend to...

7 years ago | 0

| accepted

Answered
Nested for loop for contour plotting of Laplace equation
There are more problems that that one line. When I ran your code, I discovered that most of your (unfortumately-named) ‘sum’ ma...

7 years ago | 1

| accepted

Answered
How to search for the optimal parameters of a filter
The Savitzky-Golay filter is very good for some applications and not appropriate for others. I use it as a relatively straightf...

7 years ago | 0

| accepted

Answered
Using If statement with data from excel
Do the threshold operation before you do the substitution: numData = randi(500, 1, 10); ...

7 years ago | 0

| accepted

Answered
How to cancel same pole-zero pair for Z-function ?
The minreal function works with discrete systems. Example — n = [1 -9 26 -24]; d = [1 -12 41 -42]; tfs =...

7 years ago | 1

| accepted

Answered
I need to solve four differential equation with four unknown variable simltaneously . how can i do that in matlab?
See: Optimizing a Simulation or Ordinary Differential Equation

7 years ago | 0

Answered
How do I use the value of a variable in function?
I can’t follow what you’re doing, however ‘logical indexing’ is likely the best way to do what you want, considering the way you...

7 years ago | 0

Answered
Exporting table into a .dat file
My first thought would be to use the writetable function.

7 years ago | 0

Answered
How can I plot this complex summation to infinity ?
You can’t. Use meshgrid or ndgrid to calculate the ‘x’ and ‘t’ matrices. (You will have to have them as matrices for your fu...

7 years ago | 0

Answered
Using two vectors to scale a vector
The NaN values at the ends are because interp1 must extrapolate and needs to be told how to do it. Try this: scaledx3 = int...

7 years ago | 0

| accepted

Answered
reverse 3D euclidean distance
Try this: P=[3 1 4;12 1 4; 34 2 4]; D=[81 36 601]; fcn = @(b,x) (b(1)-x(:,1)).^2 + (b(2)-x(:,2)).^2 + (b(3)-x(:,3)).^2; B...

7 years ago | 1

| accepted

Answered
count number of variance in CSV files
Some of your columns have all the same values, so for those, just take whatever number is in the first row as the value and the ...

7 years ago | 0

| accepted

Answered
What is the best way to plot time-frequency plots in MATLAB 2019?
The spectrogram function is the obvious choice here, and there are related functions (linked to in and at the end of that page) ...

7 years ago | 0

Answered
Extract num and den in symbolic expression.
Use the sym2poly funciton: syms a b c s num = 1*s^2 + 2*s + 3; n = sym2poly(num) n = 1 2 3

7 years ago | 0

| accepted

Answered
Regular Expression to timestamp
I would just use the hour, minute and second functions. Note that second will give you the fractions as well. If you want ...

7 years ago | 0

| accepted

Answered
hypothesis testing in matlab
The t-test assumes that the data are normally distributed with equal and unknown variances. It is appropriate if you know your ...

7 years ago | 1

Answered
Noise in FFT of acceleration after windowing
Your signal has broad-band noise, so no frequency-selective filter (of which windows are a subset as you are using them) will el...

7 years ago | 0

| accepted

Answered
Scatter Plot Extension to Entire Figure
My guess is that you want a surface plot. Getting from points to a surface can be relatively straightforward if your data are g...

7 years ago | 0

| accepted

Answered
Using Accumarray to calculate the number of times data has fallen into a bin
You are very close. You likely need to use the unique function with ‘Z’ so the bins and their counts are correctly aligned. ...

7 years ago | 1

| accepted

Answered
how to add columun values to another 3th columun in a matrix without touching the other columns
It would be helpful to have more details of your code and what you want to do. Try this: avg = avgPower(:,3)+a; You do the...

7 years ago | 0

| accepted

Answered
minimisation of a variable with fminsearch involving many variables
Only you know if your code is correct. Other than correcting for syntax errors (I used the vectorize function on your ‘f’ funct...

7 years ago | 0

| accepted

Answered
add uniform random number to matrix
I am not certain what you are asking. If you want to add different uniform random numbers with a minimum value of 1 and a max...

7 years ago | 0

| accepted

Answered
Finding frequency of values in an array
One approach: negPhase = nnz(Phase < 0); % Number Of Values < 0 [uPhase,ia,ic] = unique(Phase); tal...

7 years ago | 2

| accepted

Answered
To find max peak intensity
The findpeaks function (or the islocalmax function) are what I would use, although the max function is also an option for findin...

7 years ago | 0

| accepted

Load more