Answered
how to apply pso to formula
The parameters have to be elements of a vector (and the appropriate operators must be provided, in this instance multiplication)...

5 years ago | 0

| accepted

Answered
how can i extract the last two digits of a big number e.g 2454152
One approach — number = 2454152; Out = rem(number,100) .

5 years ago | 1

Answered
Calculation of rise time of skin conductance data
The data are certainly available, however making sense out of them is difficult. Is there a time vector? The risetime func...

5 years ago | 1

| accepted

Answered
Check for coordinate pairs matches in .mat file
If I understand the problem correctly, the ismember function may be appropriate — List = randi(9, 10, 2) toMatch = randi(9, 1...

5 years ago | 1

| accepted

Answered
Why isnt plot working for this code?
It will work with the for loop if (1) the plot call plots points instead of lines, or (2) if the values are subscripted inside t...

5 years ago | 0

Answered
Approximating sharp changing time dependent term for use with ODE solver
The documentation secion on ODE with Time-Dependent Terms uses interp1 that also has a number of different methods to do the int...

5 years ago | 0

Answered
Solve equation with multiple values for V
Another approach — Vr = 12; Vi = 3; Pr = 5000; syms n V = [3;3.5;4;4.51;5;5.5;6;6.5;7;7.5;8.01;8.5;9;9.5;10;10.49;10...

5 years ago | 0

| accepted

Answered
How to extract data with multiple headerlines locations, with a differing number of headerlines per file?
My apologies, however this has to be the most inelegant code I ever wrote. It has the virtue of being able to read the posted...

5 years ago | 1

Answered
How can i replace a string to a numeric value in a specific column of an array ?
I am not certain if ‘string’ refers to character vectors or string variables. Try this — column = ['M';'B';'M';'M';'B';'B']...

5 years ago | 0

Answered
Finding the turning point on the left side of a peak
‘... the turning point on either side of the major peak’ Those are referred to as the Q and S deflections (or waves). Th...

5 years ago | 0

| accepted

Answered
Help. Plot graph calculation
A somewhat more analytic representation — x = linspace(-1, 3, 250); y = (x).*((x >= 0) & (x < 1)) + (2-x).*((x >= 1) & (x < 2...

5 years ago | 0

Answered
Solving for angle (Beta) using vpasolve
That’s the result I get when I solve it (and then correct it by ) — M1 = 3; P1 = 1; theta2 = 5; thetha3 = 20; gamma = 1....

5 years ago | 0

| accepted

Answered
extract especific rows from matrix
One option — c = [202002041000 25 202002041015 35 202002041030 54 202002041045 ...

5 years ago | 0

| accepted

Answered
How can I get a time versus amplitude graph from the waveform.
The spectrogram function returns amplitude (the ‘z’ axis of the rotated surf plot) in units of dB/Hz, so it will not produce the...

5 years ago | 1

| accepted

Answered
Issue with Quiver plot
I have absolutely no idea what the desired result actually is. One option: negate ‘x2’ Another option: set(gca, 'XDir','r...

5 years ago | 0

| accepted

Answered
How to use duration data in the x axis of a patch graph?
Post the code and post the MATLAB version you are using. Only in the last 2 releases (that I am aware of) has patch supported d...

5 years ago | 0

| accepted

Answered
What do I do next to solve for m?
The conditions only apply if the values of the constants are not defined first. Try this — syms f m g L I f = sym(0.1); ...

5 years ago | 1

Answered
dirac() and ode45 issue
I doubt that the dirac call is actually necessary. The code works correctly without it — tspan1 = 0:0.00000001:0.01; x0=...

5 years ago | 0

Answered
Trouble with symbolic integrals
Since the desired result is numeric, use vpaintegral — syms x; f = exp((x^2-1)/2)/(1-x^2)^0.5; int_f = vpaintegral(f,-1,1)...

5 years ago | 1

Answered
Plot figures in the same figure (MATLAB)
Add the second matrix to the code, concatenate it with ‘H’ along dimension 3, then use a for loop to address and plot them. H...

5 years ago | 0

| accepted

Answered
How to extract symbolic parts and corresponding constant values with division in symbolic polynomials?
I cannot find any function that would return the desired result, however ther are other options, a few of which are — syms x...

5 years ago | 0

Answered
How to plot multiple y values for a single x value
The plot function figures this out automatically — A = randn(512,10); x = 1:10; figure plot(x, A, '.') xlim([0 11]) ...

5 years ago | 1

| accepted

Answered
INDEX IN POSITION 1 EXCEEDS ARRAY BOUNDS (MUST NOT EXCEED 3)
These — for i = 1 : n Sum = 0; for j = 1 : n should instead be — for i = 1 : size(a,1) ...

5 years ago | 0

| accepted

Answered
find the intersection of the four corner and trim the value out of the corner
Solve for the intersections, then plot to those limits — grid on syms stress1 stress2 shear12 SL_Ts=1800; SL_Cm=1400; ST_T...

5 years ago | 0

| accepted

Answered
Integration of a function having constant parameter
Try this — syms a x F = int((4*a - 2*x + 4*a*x - 3*a*x^2 - 2*a*x^3 + a*x^4 - x^2 + x^3), x, 0, 1) Ffcn = matlabFunction(F) ...

5 years ago | 1

| accepted

Answered
plot nonlinear equation in x y coordinate
Try something like this — syms x y SL_Ts=1800; SL_Cm=1400; ST_Ts=40; ST_Cm=230; SLT=100; k=((x^2/(SL_Ts^2))-((x*y)/...

5 years ago | 0

| accepted

Answered
Interpolated contour plot with excel data
I’m guessing as to what ‘x’ and ‘y’ are, however it will be easy to reverse them if I guessed wrong. T1 = readtable('https...

5 years ago | 0

| accepted

Answered
Plot scatter plot as shade
Try this — LD = load('conc.mat'); conc = LD.conc; t=[0;30;60;120;300;600;900]; figure plot(t, conc) hold on shadeWidth...

5 years ago | 0

| accepted

Answered
please give me answer what is wrong
The differential equaton apparently does not have an analytic solution. Integrating it numerically is an option — syms y(x)...

5 years ago | 0

| accepted

Answered
ode89 and ode78 are unrecognized in MATLAB 2021a
From the last line in the ode78 and ode89 documentation — Introduced in R2021b .

5 years ago | 1

| accepted

Load more