Answered
For loop with linspcace - for a multiple plots?
Use nested loops: beta= 2 : 0.1 : 6; omega = 2*pi*2856; Qo = 7E+4 : 500 : 1.2E+5; U_in1 = 1; y1 = 0; alfa = (2*beta)./(1+...

8 years ago | 1

| accepted

Answered
How to take the Fourier transform of a speech signal?
See the documentation on the fft (link) and spectrogram (link) functions.

8 years ago | 0

Answered
Reducing the order of Transfer function
If you have not already used the minreal (link) function, see if it will reduce the order. Beyond that, I have no specific su...

8 years ago | 3

| accepted

Answered
Optimize objective function with a random value?
It seems that you are doing a nonlinear parameter estimation problem, fitting your model to data, rather than an actual optimiza...

8 years ago | 0

| accepted

Answered
time string into seconds
See if the seconds (link) function will do what you want. Your times need to be a duration (link) array.

8 years ago | 0

Answered
How to correct ode45 errors?
First, do not use global variables! Second, you need to declare your function correctly, and pass the extra parameters to it...

8 years ago | 0

| accepted

Answered
symbolic definition disabled in MATLAB r2017b
Run these lines from your Command Window or a script: restoredefaultpath rehash toolboxcache and see if that fixes the pro...

8 years ago | 0

Answered
Convert sound of heart beat into beats per minute
I worked on that for a while, including attempting wavelet denoising, without success. The heartbeats are easily audible, howev...

8 years ago | 1

Answered
How to define and plot a piecewise time dependent function
The double logic operators (&&, ||) are short-circuit operators and operate only on logical values. They will not work in your ...

8 years ago | 0

| accepted

Answered
I keep getting the error "subscript must either be real positive integers or logicals" even when I place an 'if' statement
‘I thought that my ' if ' loop would have solved that issue, but it does not seem to be working.’ It is working in the if block...

8 years ago | 0

| accepted

Answered
Error in fmincon-NaN values
The usual method MATLAB toolboxes use to deal with NaN values in data is to omit the entire row that has a NaN value in any colu...

8 years ago | 0

| accepted

Answered
bar graph doesn't show whole data
Try this: bar(imp_2d_7_f) xtv = get(gca, 'XTick'); xtl = {'ALGO','ALIC','ALRT','ANKR','BRAZ','CAS1','CCJ2','CKIS','MAS1','MA...

8 years ago | 1

| accepted

Answered
Changing the refline name in the legend
Try this: figure scatter(rand(1,10), rand(1,10), 's', 'DisplayName','Validation') hold on scatter(rand(1,10), rand(1,10), '...

8 years ago | 0

Answered
Index exceeds the number of array elements (1)
This line is throwing the error: RMIN = RMIN(NX*NY); Since ‘RMIN’ is a scalar, it seems that you might be missing a multiplic...

8 years ago | 1

Answered
Is it possible to assign the constant value of a function handle to a variable?
If you want to use the feval (link) function, yes: g = @() 1; B = feval(g) producing: B = 1 There may also be other...

8 years ago | 1

| accepted

Answered
Matrix multiplication and addition
If I understand correctly what you want to do, this works: Result = sum(b(1:4,:) * a(:,6)); producing: Result = 760 ...

8 years ago | 0

Answered
Labelling peaks on a graph
Use the findpeaks (link) or islocalmax (link) function, and the text (link) function.

8 years ago | 3

| accepted

Answered
Surface plot form 1d data
We have absolutely no idea what result you are expecting. Try this: %% 1D line plot x = linspace(0,1000,1000); C = @(...

8 years ago | 0

Answered
Ignore text in a txt file
It depends on the function you are using to read them. In the textscan (link) and other functions that use textscan, they are ...

8 years ago | 0

Answered
Having trouble solving system of equations
Use the correct syntax for solve, and use the vpa function to get numeric results: syms c1 c2 [C1,C2] = solve(c1==18*c1-1200+...

8 years ago | 1

Answered
help with ode solvers non-linear ode 1st law of thermodynamics
I let the Symbolic Math Toolbox have its way with your equations: syms w Ao q Ap Pa k L g t y(t) P(t) m(t) V c Y Dy = diff(y...

8 years ago | 1

| accepted

Answered
How to peform multiple paired-t tests
You need to be very careful doing multiple comparisons. See the documentation for this multcompare (link) function (there are t...

8 years ago | 1

| accepted

Answered
Displaying for loop iterations as a matrix
I am guessing here: Rv=0.6:0.05:0.95; for k1 = 1:numel(Rv) R = Rv(k1); A=[(1.5*R-1.59), 0.5*R, 0; 0.5, -21.75, 0; 0...

8 years ago | 0

Answered
Can't run an equation in a function that works in a script
Try this: function [y] = test(x) c1 = 0.5176; c2 = 116; c3 = 0.4; c4 = 5; c5 = 21; c6 = 0.0068; % equation 1 lamdai1 z...

8 years ago | 0

| accepted

Answered
What is the solution for below code? It shows error
I suspect the error refers to this assignment: [,F,T,P]= spectrogram(y,NW,[],[],fs); (that also seems to be missing an output...

8 years ago | 0

Answered
3D plotting in Matlab
If you are plotting vectors, use the plot3 (link) function. Other possibilities are scatter3 (linked to in the plot3 page), and...

8 years ago | 0

| accepted

Answered
Update Matlab's font list
There are a few font utilities in MATLAB. See the documentation on the listfonts (link) function, and links to related function...

8 years ago | 0

Answered
Integration is not evaluated inside a function file
In the MATLAB Symbolic Math Toolbox, the correct syntax for your int call would be: q1 = int(FF,b,0,a1) However, I do not und...

8 years ago | 1

| accepted

Answered
Why am I not getting an array of answers from this operation?
Because you coded it with incorrect syntax. Try this: t=linspace(0,3.5,1000); u=4*exp(-0.45*t).*sin(4*t + 0.5); figure ...

8 years ago | 0

Answered
Plotting 1402 data points for a voltammogram
‘... when i try 'plot(x,y)' it says I have too many input arguments ..’ You probably have a variable (or your own function) t...

8 years ago | 0

Load more