Answered
Integral returning infinity for a definite integral with a finite value
I can’t reproduce that in R2018b. Your code works as expected: s = 14; func = @(L) s.^(-0.3) .* L.^(-0.7) .*exp(-L./s); f...

8 years ago | 0

Answered
How to solve error when calculating an array of angles that fluctuate above and below 0
It’s impossible to determine what the problem is without seeing your code. A guess might be to replace atan (or atand) with a...

8 years ago | 0

Answered
How to Plot the Trajectory of a Point
Experiment with this: P4vct = nan(numel(b),2); % Preallocate Before The ‘n’ Loop then add these two lines ...

8 years ago | 0

| accepted

Answered
step response of a signal
Your ‘const*t’ signal is a ramp function. Probably the easiest way to do what you want is to use the lsim function: s = tf('s...

8 years ago | 0

| accepted

Answered
How can I find the intersection point between 2 graphs?
Use the interp1 function: x = [0:10:5000]; Xumix1 = 0.12 * x.^2; % Create Data Intersect_y = interp1(...

8 years ago | 0

| accepted

Answered
connect set points in two arrays
I do not understand what you want to do. It would seem that the ismember (link) function or ismembertol (link) function (for ...

8 years ago | 0

Answered
why do i keep getting this error:attempted to access f1(0,200); index must be a positive integer or logical
The problem is obvious: f1(0,200) Note that 0 is not a positive integer. Positive integers are integers greater than 0.

8 years ago | 0

| accepted

Answered
How to add 1 into the array
Try this: binadd = @(a,b) dec2bin(bin2dec(a) + bin2dec(b)); % Create Function M = '100'; N = binadd(M, num2str(1)) O ...

8 years ago | 1

| accepted

Answered
Plotting the maximum amplitude of p as a function of range.
It seems that the first figure does exactly that. I would also put each loop in a separate figure: figure for ... end ...

8 years ago | 0

| accepted

Answered
How can I change the values on the axis of a graph?
Try this: figure plot((0:30), rand(1,31)) xt = get(gca, 'XTick'); strc = compose('%d', -20:5:40); xtv = linspace(min(xt), ...

8 years ago | 1

| accepted

Answered
How to create a frequency table using a list of string values
I would use unique and accumarray. An example is given in the documentation section Count of Unique Elements (link).

8 years ago | 0

| accepted

Answered
Help solving a second order differential equation
If you use the numeric initial conditions, you get the trivial solution only, that being 0. If you want to see the full expre...

8 years ago | 0

Answered
Adding Two Extra Lines to a Scatter Plot
I am not certain what the dashed lines are. If they are confidence bounds on the centre regression line, the File Exchange cont...

8 years ago | 0

Answered
Where can I find the R2018b Update 1 installer?
On the top toolbar in the main MATLAB window, click on the arrow below the Add-Ons button, Check for Updates Products. That wi...

8 years ago | 2

Answered
Adding Vertical Lines to all Points on Plot
See if any of these do what you want: T=[5 10 100 1000 10000]; figure stem(T, 'filled') grid figure stem(T, ones(size...

8 years ago | 3

| accepted

Answered
Problem with for loop plotting a graph
The Symbolic Math Toolbox is inefficient for this sort of problem. Try this: U = 1; B = 0.1; H = 0.5; pfcn = @(a) [2*exp...

8 years ago | 1

| accepted

Answered
How can I create a 3D contour Plot from X,Y,Z table?
Try this: d = csvread('Cell Surface Pressure.csv'); p = d(:,1); x = d(:,2); z = d(:,3); xv = linspace(min(x), max(x), 10...

8 years ago | 2

| accepted

Answered
problem using stem command
Try this: rec_start = 1.625608000000000e+03; rec_stop=1.655613000000000e+03; lev_press=[1629.599, 1630.297, 1633.178]; x = ...

8 years ago | 1

| accepted

Answered
How can I resolve "Nonscalar arrays of function handles are not allowed; use cell arrays instead." for this code?
You likely do not need the for loop anyway. There are other significant problems with your code that I found and fixed, particu...

8 years ago | 0

Answered
Can I store indefinite integral using a function handle?
See if this does what you want: syms x a(x) = x^2; b(x) = int(a(x)); bfcn = matlabFunction(b) produces: bfcn = func...

8 years ago | 1

| accepted

Answered
Considering this figure, what is the optimal cut off frequency using a low-pass cutoff?
It depends on how much detail you want to retain. It looks to me that 10 Hz would likely work to eliminate most of the high-fre...

8 years ago | 1

| accepted

Answered
What are the Methods to remove the low freq. components from the ECG signal ?
Use a highpass (or perhaps a bandpass) filter, with the appropriate low-frequency cutoff (passband of 2 Hz and stopband of 1 Hz ...

8 years ago | 0

Answered
Bar chart with double Y axis and error bars
See: Bar Plot With Error Bar (link) for an example. We cannot run your code, so we cannot give a specific example with respec...

8 years ago | 0

Answered
Merging data for output
It depends on what you want. This creates the vector as the column of the resulting matrix: f = rand(1, 10681); fdat = ra...

8 years ago | 0

Answered
Deleting specific dublicates out of an array
I have absolutely no idea what your ‘B’ array actually looks like or how it is constructed. If the elements of ‘B’ are indivi...

8 years ago | 0

| accepted

Answered
plot a vector with 3 axes
In this universe, we are limited to 3 large dimensions (although 11 may actually exist). The dimension in the plot can be the ...

8 years ago | 0

| accepted

Answered
How do I add channels to exclude while keeping the channels already excluded?
If you want to add 46 to the bad channels, probably the easiest way is to ‘grow’ the vector: bad_channel = [bad_channel; 46]; ...

8 years ago | 0

| accepted

Answered
Running for loop to run values through symbolic matrix
Create ‘a1’ as: syms a1(f) f a1(f) = [1,2*f/3;0,1]; ... I have no idea why you are doing the same thing 100 times. Using ...

8 years ago | 1

| accepted

Answered
how can I put a threshold on the dataset?
Probably the easiiest way: Anew = A(A(:,1)>=1E+4, :) This keeps the rows with the first column greater than or equal 10000. ...

8 years ago | 0

| accepted

Answered
Split Histogram - individual and total percentages display
The problem is with your ‘binranges’ assignment. The colon (link) operator increments by default by 1, so the result of: binr...

8 years ago | 0

Load more