Answered
How would I make a script to find the Diagonal of a matrix?
Hi, Curious Alicia Gillies! I would do this: M = ...; % Your Matrix for k = 1:m...

9 years ago | 0

Answered
Max values in certain columns with corresponding row value?
*_‘How do I get MATLAB to show me that it happens at 6 hours, not row (location) 4?’_* Since _‘row (location) *|4|*’_ is an...

9 years ago | 0

Answered
how to compute dft of sin wave
The documentation explains it best. See: <https://www.mathworks.com/help/releases/R2015a/matlab/ref/fft.html *|fft|*> (link...

9 years ago | 0

Answered
Why isn't MATLAB returning all menu options?
Try <https://www.mathworks.com/help/matlab/ref/listdlg.html *|listdlg|*> (link) instead: % Prompt user to select a day ...

9 years ago | 0

| accepted

Answered
dsolve complex explicit answer
Try this: syms y(x) x eqn = diff(y) == (-x^2+x)/(y^2-2*y); y0 = [-3 -2 -1 1 2 3]; for k = 1:length(y0) con...

9 years ago | 0

| accepted

Answered
finding MSE of elements in an array
The Wikipedia article on <https://en.wikipedia.org/wiki/Mean_squared_error *Mean squared error*> (link) states _‘For an unbiased...

9 years ago | 0

| accepted

Answered
Create a matrix with a for loop
Yes. Create a vector from your original *|‘i’|*, then refer to it by subscript. This works: iv = -3:.5:2; for i =...

9 years ago | 0

| accepted

Answered
Please summarize the solution of the code and the graphical output .
It evaluates *|‘sin(k)/k’|* for *|‘k’|* from *|1|* to *|1000|* radians in steps of *|1|* radian, and then cumulatively sums the ...

9 years ago | 0

Answered
I would like to have two y-axis and corresponding y-axis ticks and ticks values but with a single set of data points.
This works: x = logspace(-3, -1, 10); % Create Data y1 = logspace(-10, -5, 10); ...

9 years ago | 1

| accepted

Answered
Anyone know how I can use normplot to have a logarithmic scaling of the x-axis like this old timey version?
It works correctly for me in *|R2017b|*: y = randn(1, 100) + rand(1,100); figure(1) probplot(y) set(gca, 'XSc...

9 years ago | 0

Answered
Solving Differential Equation with initial conditions
You need to add the initial conditions as arguments to *|dsolve|*, and use the ‘double equal’ to assign them: S_1s = dsolv...

9 years ago | 0

| accepted

Answered
Fit a function given by the derivative of a nonlinear function to data
If you are fitting a hysteresis curve, see if the approach in <http://www.mathworks.com/matlabcentral/answers/129956-how-to-find...

9 years ago | 1

| accepted

Answered
I want plot multiple curves on a same figure but unable to do so, please help..
Try this: Cv = 0.2:200; for kk = 1:numel(Cv) C = Cv(kk) * 10^(kk-1); ...

9 years ago | 0

Answered
Using fzero, how to display the values of all the variables that makes the function equal zero?
Finding the value for *|‘x’|* requires that you make both *|‘y’|* and *|‘f’|* functions of *|‘x’|* to find the value of *|‘x’|* ...

9 years ago | 1

| accepted

Answered
How can I show only the outer outline of all the histogram bars as in this picture:
If you are using the <https://www.mathworks.com/help/matlab/ref/histogram.html *|histogram|*> (link) function, set *|'DisplaySty...

9 years ago | 0

| accepted

Answered
How to plot a frequency of respiration signal on y-axis while time of measurement is on x-axis?
This should get you started: D = load('respiratory.txt'); Fs = 25; %...

9 years ago | 2

| accepted

Answered
New to matlab and am getting index exceed matrix dimensions error
I would use *|‘F2’|*, since you already calculated it: S = sum(abs(y - F2)); This avoids the error, and the inefficienc...

9 years ago | 0

| accepted

Answered
Issue with the number of outputs in my function
The default behaviour for function output is to return only the first output unless you ask for all of them. This will ret...

9 years ago | 0

| accepted

Answered
Comprehensive list of modifiers?
There is. At the end of the page, especially for graphics functions, a link to the object properties will be at the end of ...

9 years ago | 0

Answered
How do I keep a count of the number of operations my function has performed?
If you’re using a *|for|* loop, store the value of the index variable value after exiting the loop. Otherwise for a *|while|* l...

9 years ago | 0

Answered
Plotting a temperature graphs of a heat equation of a rod
The Symbolic Math Toolbox isn’t the best option for this. It’s possible to vectorise the *|sin*exp|* term, and is only necessar...

9 years ago | 2

| accepted

Answered
Dividing data set into subsets and plot them on same graph, with individual trend lines
If you have the Statistics and Machine Learning Toolbox, using the <https://www.mathworks.com/help/stats/lsline.html *|lsline|*>...

9 years ago | 0

Answered
equation 7.4.10 from handbook of mathematical functions
you need to vectorise the division as well as the exponentiation: fun = @(t) exp(-t.^2)./(t+1); ↑ ...

9 years ago | 1

Answered
Least squares matrix?
Use the <https://www.mathworks.com/help/matlab/ref/mldivide.html *|mldivide,\|*> (link) operator instead: b = A\y; b ...

9 years ago | 0

Answered
Place polyfit values in a matrix using a loop
I am not certain what you want to do, specifically because you are not doing anything with *|‘temp_x’|* and *|‘temp_y’|*. P...

9 years ago | 0

| accepted

Answered
Find peaks from spectrogram
This is similar to locating DTMF tones. See for example <http://www.mathworks.com/matlabcentral/answers/259953-how-can-i-detect...

9 years ago | 0

Answered
How to give unique id to similar row
I am not certain what result you want. The *|unique|* function might be an option: A = [30 10 30 191 ...

9 years ago | 1

| accepted

Answered
Can someone help me convert this Rstudio code to Matlab?
It seems to be documented in <https://cran.rstudio.com/doc/manuals/r-release/R-intro.html#Generating-regular-sequences *Generati...

9 years ago | 0

Answered
filtering and smoothening of acquired data due to noise
It depends on the frequency characteristics of the noise. If your signal is limited to a specific part of the frequency spectru...

9 years ago | 0

Load more