Answered
How do I fix this error? Not enough input arguments.
Your ‘a_p’ function has no idea what ‘a2’ and ‘b2’ are because you have not shared those with them. Try this: function valu...

7 years ago | 0

| accepted

Answered
matlab plot, interrupted line when y is zero
Try this, using your own ‘x’ and ‘y’ vectors: x = 0:10; % Create Data y = randi([0 5], 1, 1...

7 years ago | 0

Answered
how can I plot a unit step function?
The unit step function is also knoiwn as the heaviside step function.

7 years ago | 0

| accepted

Answered
Why it doesn’t work out?
It means you also need the Wavelet Toolbox.

7 years ago | 0

| accepted

Answered
How to generate a set of variables with increasing numbers related to the indices of another array?
You can do that more easily with simple matrix-vector multiplication: z = y(:)*x producing: z = 1 1 1 2...

7 years ago | 0

| accepted

Answered
how to multiply values between arrays columns to rows and generate a new vector form each of the multiplication?
The operation you are looking for is not actually multiplication, it is convolution. Example: x = [ 1 1 1 ]; y = [ 1 2 3 ]...

7 years ago | 0

| accepted

Answered
writeTable won't take my parameters
The error was with table, not writetable. You are not creating the table correctly. Try this: titles={'the' 'hungry' 'dog'...

7 years ago | 0

Answered
I need turnover for last month from my table
Try this: dv = datetime({'01-Jul-2019 17:00:39'; '24-Jul-2019 14:00:18'; '01-Aug-2019 16:00:35'; '15-Aug-2019 15:40:24'; '21-A...

7 years ago | 1

| accepted

Answered
3d plot help
The description ‘Time at x-axis , cost at y-axis and Profit = revenue - cost at y-axis’ describes a 2D plot. Try this: D = ...

7 years ago | 2

| accepted

Answered
How can i find the intersection of two lines between points? One of the lines isnt well behaved
Try this: x = linspace(0, 1, 40); % Create Data y1 = 1.0592*ones(size(x)); ...

7 years ago | 1

| accepted

Answered
Plotting multiple piecewise functions onto the same graph
I coded and ran ‘y1’ as: y1 = @(x) ((0<x) & (x<1.85)).*sin(523.26*pi*x) + ((1.85<x) & (x<3.7)).*0 + ((3.7<x) & (x<5.55)).*sin(...

7 years ago | 0

| accepted

Answered
How to write a legend in latex format
Try this: Npc=2; legend(sprintf('\\Sigma_{i=1}^{%d} x^\\prime_i',Npc),'Total L_w','Noise'); That worked correctly when I tes...

7 years ago | 2

| accepted

Answered
Saving Data In A For Loop Into An Array
The easiest way would probably be to save them all in separate cell arrays, here ‘xc’, ‘yc’, and ‘zc’: for columns=1:4 fo...

7 years ago | 1

| accepted

Answered
Index a series of integers in a column of matrix
I am not sure what you want. Try this: T2 = [2 7 4 5 1 0 1 3 1 5 6 7 4 7 2 7]'; Idx = strfind(T2', [2 7]) Out = T2([Idx(:...

7 years ago | 0

| accepted

Answered
How can I convert (x,y) points(double) into cell
If yu want to store them individually as cells, the num2cell function will work. Otherwise see if the mat2cell function will ...

7 years ago | 0

| accepted

Answered
find the element location
You have encountered ‘floating-point approximation error’. Most numbers are not exactly represented in floating-point precision...

7 years ago | 1

| accepted

Answered
importing excel data using for loop
This variation on your loop will generate the names that you can then use for your readtable calls: for kk=1:24 fv = sp...

7 years ago | 0

| accepted

Answered
how can i plot ?
Try this: A=[2.8866 2.5708 2.9381 2.6234 2.7873 2.8535 3.5818 4.1817 3.6535 4.6312 4.2028 4.4...

7 years ago | 0

| accepted

Answered
Plotting FRF with imaginary and real numbers
‘I would like to know if it is possible to plot the graphic of it (resulting in the natural frequencies and stuff) only having t...

7 years ago | 0

| accepted

Answered
parameter estimation for a set of differential equations using fmincon function in matlab
You will likely find Monod kinetics and curve fitting helpful. (There are similar posts as well.) One way to force ‘dcdt’ to...

7 years ago | 0

Answered
How to integrate a set of coupled ODE's?
Your system is ‘stiff’, so use one of the stiff solvers instead of ode45: [t,y] = ode15s(@rate_eq,tspan,y0); With this chang...

7 years ago | 0

| accepted

Answered
there are more than 1 element satisfy the command in one column, but I only need to count it one time
Try this: maxTemp = max(data(:,4:end),[],2); Above41 = nnz(maxTemp > 41) producing: Above41 = 3

7 years ago | 0

| accepted

Answered
matlab returns different result for same inputs
You may believe that the value of ‘x’ and the value of ‘x’ that are displayed are the same. They are likely much different, sin...

7 years ago | 1

| accepted

Answered
find slope sign change of emg signal
Use the gradient function to produce results that are the same sizes as your data, not diff. If ‘EMG’ is your (30000x4) signa...

7 years ago | 0

Answered
When do you detrend data or remove the mean?
Both detrending and removing the mean are essentially removing low-frequency baseline variations or a constant offset, respectiv...

7 years ago | 0

Answered
how to plot step graph
I am not certain what a ‘step graph’ refers to. Try this: figure stairs(W, X, 'LineWidth',2) grid

7 years ago | 2

| accepted

Answered
How to fit differential equations to a curve
I would normally suggest that you see Monod kinetics and curve fitting and others. However this is actually a linear problem, s...

7 years ago | 0

| accepted

Answered
how to fix invalid first data argument
Your code runs without error for me. Note that in your code ‘ii’ is never going to be less than 0, so the entire if block is ...

7 years ago | 0

Answered
Cannot load default file for CWT
If you listed the entire result from running the ver function, it seems that you do not have the Wavelet Toolbox.

7 years ago | 0

| accepted

Answered
I have multiple equations that depend on a specific value and would like matlab to ask the user which equation to use and what the specific value is and then print that value but it's giving me trouble.
The 's' indicates that input for ‘lambda’ should return a character vector, so it does. If the materials are numbered, so the...

7 years ago | 0

Load more