Answered
Baseline Correction of IR Spectra
It is not possible to provide specific code without your data. See for example: Raman spectra background removal and Shifting...

6 years ago | 0

| accepted

Answered
Number of cycles before and after FFT
Brad — You requested that I answer this so I’ll do my best. It appears to me that ‘some processing’ is essentially some sort ...

6 years ago | 0

| accepted

Answered
Finding Zero Crossing of Signal
The end of your code now becomes: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%% close all figure;...

6 years ago | 0

Answered
Zero Crossing of Signal
The ‘zci’ funciton works correctly, although the latest version of it is: zci = @(v) find(v(:).*circshift(v(:), 1, 1) <= 0); ...

6 years ago | 2

| accepted

Answered
Matlab functions not interacting with main program.
Your function works correctly. You need to return the changed ‘A’ to your workspace (I call it ‘Ac’ here): A=[1 2 3 4 5]; ...

6 years ago | 1

Answered
Why is the derivative of a function or signal one sample shorter that the orignal?
Use the gradient function to calculate the numerical derivatives. The output will be the same length as the input. (It is also...

6 years ago | 1

| accepted

Answered
How do I offset a plot curve only in the y axis?
Try this: figure ezplot(@(x) (-0.5*x.^(1.85)) / (2*5^(0.85))); L1 = findobj(gca, 'Type','Line'); L1.YData = L1.YData + 2.5;...

6 years ago | 0

| accepted

Answered
Plot high frequency noise.
This would likely work: noise_only = y - a1*sin(b1*x+c1); then to plot it: figure plot(x, noise_only) grid .

6 years ago | 0

Answered
How to plot line on graph
Without your data, providing exact code is not possible. In the interim, try this: [pks,locs] = findpeaks(classAccuracy); ...

6 years ago | 0

| accepted

Answered
How to solve for all 5 values of x?
I would use a loop: T= (473:50:673); K=exp(21.225+(9143.6./T)-(7.492*log(T))+((4.076*10^-3)*(T))-(7.161*10^-8).*(T).^2); s...

6 years ago | 0

| accepted

Answered
How to insert a degree symbol in matlab using input function?
I would just use ALT+0176. I did that here and it seems to work: a = input('If your initial temperature is 25° C, then what i...

6 years ago | 0

| accepted

Answered
How do I solve a system of ODE with time-dependent parameters ( as discrete points, not as function) in MATLAB?
It also depends on what the ‘discrete values’ are, what they represent, and how you want to use them. See the documentation s...

6 years ago | 0

Answered
Fill between two lines not working
Plot everything (including the patch calls) using linear axis rulers first, then convert the scale to logarithmic. See How ca...

6 years ago | 0

Answered
Simple question regarding "distance" function
Type: ver in your Command Window to see if the Mapping Toolbox is installed. It should be listed. If it is not, and you...

6 years ago | 0

| accepted

Answered
why am i getting that error
The Symbolic Math Toolbox does knt know that ‘F’ is a function. Try this instead: F(x) = input ('function = '); That worke...

6 years ago | 0

| accepted

Answered
How to make a bode plot from a transfer function
Yes. The code you posted: s = tf('s'); g = 10*exp(-0.25*s)/((1+1.2*s)*(1+3.5*s)) figure bode(g) grid should work. ...

6 years ago | 1

| accepted

Answered
How to plot "f(x,y) = e^-(x^2+y^2)" function in matlab?
Try this: figure fsurf(@(x,y)exp(-(x.^2+y.^2)), [-2 2 -2 2])

6 years ago | 0

| accepted

Answered
Add parameters in transfer function
The ‘H’ transfer function and the feedback output function can be anonymous functions: G = tf(1, [2 0 1]) H = @(k_s) tf(1, [k...

6 years ago | 0

Answered
matlab calculates cosine different from my calculator
Your calculator is calculating in degrees. By default MATLAB calculates in radians: MATLAB = cos(1) Calculator = cosd(1) pr...

6 years ago | 3

| accepted

Answered
Parameter estimation using ODE
Your ‘kinetics’ function has 9 parameters, so ‘theta0’ must have 9 elements. You have defined it as having 6.

6 years ago | 0

| accepted

Answered
Parameter Estimation of 3 ODE systems with lsqcurvefit does not converge
First, re-define ‘alpha0’ to include the initial conditions:: alpha0 = [alpha0; 80.2;4.451e-3;4.264e-3]; and change ‘kinetics...

6 years ago | 1

| accepted

Answered
Random Non-periodic waveform
Try this: C = {[1.54,2.49], [4.97,5.88], [6.69,7.98], [8.05,8.25],[8.58,9.09], [10.48,10.86], [11.16,12.97], [14.51,15.24],[15...

6 years ago | 1

| accepted

Answered
Find repeating values of the same numbers
One approach is to use the intersect function: G1 = [9 30 36 38 43 54 59]; G2 = [7 29 30 41 50 54 59]; G1G2 = intersect(G1,G...

6 years ago | 0

Answered
How to make three dimensional gragh
Try this: x = (1:10)'; y = [10 10 9 8 8 7 6 6 5 5; 9 8 7 6 6 5 4 4 4 4; 12 10 9 9 9 9 6 6 5 5]'; figure hol...

6 years ago | 0

| accepted

Answered
Should I use 1-D digital filtering or lowpass filter ?
Yes. Also be certain that the signals have uniform sampling intervals. If they do not, use the resample function to force them...

6 years ago | 1

| accepted

Answered
Can someone explain how this line in the code works?
The fzero call indicates that the code is to find the value of the ‘quintic’ function argument such that the function value equa...

6 years ago | 0

| accepted

Answered
Apply a bandpass filter in freq domain
‘So I think I need to apply a bandpass filter in freq domain.’ Don’t. That is extremely difficult, since the Fourier transform...

6 years ago | 0

| accepted

Answered
Problems fitting couple differential equations to experimental data
Running your code with random data ran without error (R2020a): t = (0:20)'; f = rand(size(t)); function [x] = knfit(t,f) ...

6 years ago | 0

Answered
How to get functions out of inputdlg
I would do something like this, using str2func and vectorize: questions = {'Enter a function of ‘x’','Enter a lower limit','En...

6 years ago | 1

| accepted

Load more